Skip to content

Commit

Permalink
Small fixes (#28)
Browse files Browse the repository at this point in the history
* Add favicon to demo pages

* Fix icon in the sidebar
  • Loading branch information
traut authored Jul 14, 2024
1 parent 3e6161d commit de07511
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .github/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/demos/drag-n-drop.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!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 {
<!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 {
font-family: sans-serif;
padding-left: 20px;
width: 800px;
Expand Down
2 changes: 1 addition & 1 deletion dist/demos/load-data.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!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 {
<!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 {
color: #eeeeee;
font-family: sans-serif;
padding-left: 20px;
Expand Down
2 changes: 1 addition & 1 deletion dist/demos/misc.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!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 {
<!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 {
font-family: sans-serif;
padding-left: 20px;
width: 1000px;
Expand Down
2 changes: 1 addition & 1 deletion dist/demos/stix21-demo.html
Original file line number Diff line number Diff line change
@@ -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>
<!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>
2 changes: 1 addition & 1 deletion dist/demos/story.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!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 {
<!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 {
font-family: sans-serif;
padding-left: 20px;
width: 800px;
Expand Down
2 changes: 1 addition & 1 deletion dist/demos/tags-and-custom-sidebar.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!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(){
<!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(){
const element = document.getElementById('graph-element');
const graph = window.stixview.init(
element,
Expand Down
2 changes: 1 addition & 1 deletion dist/demos/viewer.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!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 {
<!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 {
height: 100%;
}

Expand Down
2 changes: 1 addition & 1 deletion dist/stixview.bundle.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/demos/drag-n-drop.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<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 type="text/css">
body {
font-family: sans-serif;
Expand All @@ -11,6 +12,7 @@
line-height: 1.7em;
}
</style>

</head>
<body>
<h2>Drag-n-drop</h2>
Expand Down
1 change: 1 addition & 0 deletions src/demos/load-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<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 type="text/css">
body {
color: #eeeeee;
Expand Down
1 change: 1 addition & 0 deletions src/demos/misc.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<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 type="text/css">
body {
font-family: sans-serif;
Expand Down
1 change: 1 addition & 0 deletions src/demos/stix21-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<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"/>
</head>
<body>
<div data-stix-gist-id="05d70be673133b0b4c938057fb38da04"
Expand Down
1 change: 1 addition & 0 deletions src/demos/story.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<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 type="text/css">
body {
font-family: sans-serif;
Expand Down
1 change: 1 addition & 0 deletions src/demos/tags-and-custom-sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<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"/>
</head>
<body>
<div id='graph-element'
Expand Down
1 change: 1 addition & 0 deletions src/demos/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<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 type="text/css">
body, html {
height: 100%;
Expand Down
6 changes: 5 additions & 1 deletion src/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function renderSidebarContent(node) {
const entity = node.raw;
const tmpl = _.template(`
<img class='sidebar-type-icon'
style='background: <%= color %>'
src='<%= icon %>'>
<%= obj.type %>
<span class='sidebar-close-icon'>×</span>
Expand All @@ -27,10 +28,13 @@ function renderSidebarContent(node) {
</p>
`);

const icon = getNodeIcon(entity);

return tmpl({
obj: entity,
nodeLabel: getNodeLabel(entity),
icon: getNodeIcon(entity).image,
icon: icon.image,
color: icon.color,
});
}

Expand Down

0 comments on commit de07511

Please sign in to comment.