Skip to content

Commit de07511

Browse files
authored
Small fixes (#28)
* Add favicon to demo pages * Fix icon in the sidebar
1 parent 3e6161d commit de07511

17 files changed

+25
-9
lines changed

.github/favicon.svg

+4
Loading

dist/demos/drag-n-drop.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="UTF-8"><title>Drag-n-drop demo - Stixview</title><style>body {
1+
<!doctype html><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="UTF-8"><title>Drag-n-drop demo - Stixview</title><link rel="icon" href="https://github.com/traut/stixview/blob/master/.github/favicon.svg?raw=true"/><style>body {
22
font-family: sans-serif;
33
padding-left: 20px;
44
width: 800px;

dist/demos/load-data.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="UTF-8"><title>Dark theme from inline data - Stixview</title><style>body {
1+
<!doctype html><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="UTF-8"><title>Dark theme from inline data - Stixview</title><link rel="icon" href="https://github.com/traut/stixview/blob/master/.github/favicon.svg?raw=true"/><style>body {
22
color: #eeeeee;
33
font-family: sans-serif;
44
padding-left: 20px;

dist/demos/misc.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="UTF-8"><title>Misc - Stixview</title><style>body {
1+
<!doctype html><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="UTF-8"><title>Misc - Stixview</title><link rel="icon" href="https://github.com/traut/stixview/blob/master/.github/favicon.svg?raw=true"/><style>body {
22
font-family: sans-serif;
33
padding-left: 20px;
44
width: 1000px;

dist/demos/stix21-demo.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="UTF-8"><title>STIX 2.1 objects demo - Stixview</title><script defer="defer" src="../stixview.bundle.js"></script></head><body><div data-stix-gist-id="05d70be673133b0b4c938057fb38da04" data-stix-allow-dragdrop="false" data-show-idrefs="false" data-show-markings="true" data-show-sidebar="true" data-graph-layout="cise" data-caption="STIX 2.1 Domain and Cyber Observable objects demo" data-disable-mouse-zoom="false" data-graph-width="100%" data-graph-height="85vh" data-show-footer="true"></div></body></html>
1+
<!doctype html><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="UTF-8"><title>STIX 2.1 objects demo - Stixview</title><link rel="icon" href="https://github.com/traut/stixview/blob/master/.github/favicon.svg?raw=true"/><script defer="defer" src="../stixview.bundle.js"></script></head><body><div data-stix-gist-id="05d70be673133b0b4c938057fb38da04" data-stix-allow-dragdrop="false" data-show-idrefs="false" data-show-markings="true" data-show-sidebar="true" data-graph-layout="cise" data-caption="STIX 2.1 Domain and Cyber Observable objects demo" data-disable-mouse-zoom="false" data-graph-width="100%" data-graph-height="85vh" data-show-footer="true"></div></body></html>

dist/demos/story.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="UTF-8"><title>Writing a report with STIX2 graph, step by step - Stixview</title><style>body {
1+
<!doctype html><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="UTF-8"><title>Writing a report with STIX2 graph, step by step - Stixview</title><link rel="icon" href="https://github.com/traut/stixview/blob/master/.github/favicon.svg?raw=true"/><style>body {
22
font-family: sans-serif;
33
padding-left: 20px;
44
width: 800px;

dist/demos/tags-and-custom-sidebar.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="UTF-8"><title>TLP tags and custom sidebar - Stixview</title><script defer="defer" src="../stixview.bundle.js"></script></head><body><div id="graph-element" data-stix-gist-id="ee9e0117cac06e5014ab7838776d4d9c" data-stix-allow-dragdrop="false" data-show-idrefs="false" data-show-sidebar="true" data-show-footer="true" data-show-tlp-as-tags="true" data-graph-layout="cise" data-caption="TLP tags and custom sidebar renderer" data-graph-width="100%" data-graph-height="85vh"></div></body><script>window.addEventListener("load", function(){
1+
<!doctype html><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="UTF-8"><title>TLP tags and custom sidebar - Stixview</title><link rel="icon" href="https://github.com/traut/stixview/blob/master/.github/favicon.svg?raw=true"/><script defer="defer" src="../stixview.bundle.js"></script></head><body><div id="graph-element" data-stix-gist-id="ee9e0117cac06e5014ab7838776d4d9c" data-stix-allow-dragdrop="false" data-show-idrefs="false" data-show-sidebar="true" data-show-footer="true" data-show-tlp-as-tags="true" data-graph-layout="cise" data-caption="TLP tags and custom sidebar renderer" data-graph-width="100%" data-graph-height="85vh"></div></body><script>window.addEventListener("load", function(){
22
const element = document.getElementById('graph-element');
33
const graph = window.stixview.init(
44
element,

dist/demos/viewer.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="UTF-8"><title>Graph Viewer - Stixview</title><style>body, html {
1+
<!doctype html><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="UTF-8"><title>Graph Viewer - Stixview</title><link rel="icon" href="https://github.com/traut/stixview/blob/master/.github/favicon.svg?raw=true"/><style>body, html {
22
height: 100%;
33
}
44

dist/stixview.bundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/demos/drag-n-drop.html

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>Drag-n-drop demo - Stixview</title>
6+
<link rel="icon" href="https://github.com/traut/stixview/blob/master/.github/favicon.svg?raw=true"/>
67
<style type="text/css">
78
body {
89
font-family: sans-serif;
@@ -11,6 +12,7 @@
1112
line-height: 1.7em;
1213
}
1314
</style>
15+
1416
</head>
1517
<body>
1618
<h2>Drag-n-drop</h2>

src/demos/load-data.html

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>Dark theme from inline data - Stixview</title>
6+
<link rel="icon" href="https://github.com/traut/stixview/blob/master/.github/favicon.svg?raw=true"/>
67
<style type="text/css">
78
body {
89
color: #eeeeee;

src/demos/misc.html

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>Misc - Stixview</title>
6+
<link rel="icon" href="https://github.com/traut/stixview/blob/master/.github/favicon.svg?raw=true"/>
67
<style type="text/css">
78
body {
89
font-family: sans-serif;

src/demos/stix21-demo.html

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>STIX 2.1 objects demo - Stixview</title>
6+
<link rel="icon" href="https://github.com/traut/stixview/blob/master/.github/favicon.svg?raw=true"/>
67
</head>
78
<body>
89
<div data-stix-gist-id="05d70be673133b0b4c938057fb38da04"

src/demos/story.html

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>Writing a report with STIX2 graph, step by step - Stixview</title>
6+
<link rel="icon" href="https://github.com/traut/stixview/blob/master/.github/favicon.svg?raw=true"/>
67
<style type="text/css">
78
body {
89
font-family: sans-serif;

src/demos/tags-and-custom-sidebar.html

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>TLP tags and custom sidebar - Stixview</title>
6+
<link rel="icon" href="https://github.com/traut/stixview/blob/master/.github/favicon.svg?raw=true"/>
67
</head>
78
<body>
89
<div id='graph-element'

src/demos/viewer.html

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>Graph Viewer - Stixview</title>
6+
<link rel="icon" href="https://github.com/traut/stixview/blob/master/.github/favicon.svg?raw=true"/>
67
<style type="text/css">
78
body, html {
89
height: 100%;

src/sidebar.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ function renderSidebarContent(node) {
66
const entity = node.raw;
77
const tmpl = _.template(`
88
<img class='sidebar-type-icon'
9+
style='background: <%= color %>'
910
src='<%= icon %>'>
1011
<%= obj.type %>
1112
<span class='sidebar-close-icon'>×</span>
@@ -27,10 +28,13 @@ function renderSidebarContent(node) {
2728
</p>
2829
`);
2930

31+
const icon = getNodeIcon(entity);
32+
3033
return tmpl({
3134
obj: entity,
3235
nodeLabel: getNodeLabel(entity),
33-
icon: getNodeIcon(entity).image,
36+
icon: icon.image,
37+
color: icon.color,
3438
});
3539
}
3640

0 commit comments

Comments
 (0)