Skip to content

[fix] Remove global CSS rules to avoid conflicts #303 Refactored CSS to prevent global styling conflicts with downstream projects. Fixes #303 #317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
47dabc9
Fixing global css issue
Unnati-Gupta24 Dec 23, 2024
2960928
Fixing global css issue
Unnati-Gupta24 Dec 23, 2024
489d344
[fix] Refactor CSS to avoid global style declarations #303
Unnati-Gupta24 Dec 23, 2024
a545b1c
[fix] Remove global CSS rules to avoid conflicts with downstream proj…
Unnati-Gupta24 Dec 23, 2024
a117764
[fix] Remove global CSS rules to avoid conflicts with downstream proj…
Unnati-Gupta24 Dec 23, 2024
068d66e
[fix] Remove global CSS rules to avoid conflicts #303
Unnati-Gupta24 Dec 23, 2024
5d78f63
Merge branch 'master' into master
Unnati-Gupta24 Feb 9, 2025
e83e9b0
[fix] Remove global CSS rules to avoid conflicts #303
Unnati-Gupta24 Feb 11, 2025
699408b
[deps] Bump eslint-config-prettier from 9.1.0 to 10.0.1
dependabot[bot] Feb 20, 2025
58d9474
[[ci] Updated commit message prefix of dependabot
nemesifier Feb 26, 2025
ae4e765
[deps] Updated ECharts to version 5.6.0 #224 #305
dee077 Feb 26, 2025
203bc1c
[docs] Updated badges
nemesifier Feb 26, 2025
b0ade05
[docs] Improved run tests section
nemesifier Feb 26, 2025
d49c1ba
[deps] Bump @babel/preset-env from 7.26.0 to 7.26.9
dependabot[bot] Feb 26, 2025
6e917e8
[tests] Added more options for selenium browser testing
nemesifier Feb 26, 2025
7d45154
[ci] Added install-chromedriver: true
nemesifier Feb 26, 2025
1537731
[ci] Added more chromedriver headless options
nemesifier Feb 26, 2025
f414642
[ci] ChromeDriver changes
nemesifier Feb 26, 2025
fde1561
[ci] Run on ubuntu-latest
nemesifier Feb 26, 2025
1af5fd6
[ci] Use latest python version available on the system
nemesifier Feb 26, 2025
d1e927c
[tests] Simplified headless options
nemesifier Feb 26, 2025
50fc6e0
[ci] Updated Build & Deploy step
nemesifier Feb 26, 2025
1d606a7
[ci] Set timeout to browser tests
dee077 Feb 28, 2025
a0cc547
[deps] Bump webpack from 5.97.1 to 5.98.0
dependabot[bot] Feb 28, 2025
702509b
[deps] Bump prettier from 3.4.2 to 3.5.2
dependabot[bot] Feb 28, 2025
48624fd
[deps] Bump eslint-config-prettier from 10.0.1 to 10.0.2
dependabot[bot] Feb 28, 2025
9b41567
[deps] Bump terser-webpack-plugin from 5.3.11 to 5.3.12
dependabot[bot] Mar 1, 2025
354b663
[deps] Bump copy-webpack-plugin from 12.0.2 to 13.0.0
dependabot[bot] Mar 1, 2025
caf6c9d
[chores] Minor CSS refactoring
cestercian Mar 11, 2025
686049b
Fixing global css issue
Unnati-Gupta24 Dec 23, 2024
deae5d5
Fixing global css issue
Unnati-Gupta24 Dec 23, 2024
3c1f4e9
[fix] Refactor CSS to avoid global style declarations #303
Unnati-Gupta24 Dec 23, 2024
5edc590
[fix] Remove global CSS rules to avoid conflicts with downstream proj…
Unnati-Gupta24 Dec 23, 2024
ab00f99
[fix] Remove global CSS rules to avoid conflicts with downstream proj…
Unnati-Gupta24 Dec 23, 2024
f2ee4cc
[fix] Remove global CSS rules to avoid conflicts #303
Unnati-Gupta24 Dec 23, 2024
aa34a17
[fix] Remove global CSS rules to avoid conflicts #303
Unnati-Gupta24 Feb 11, 2025
dd64a76
[fix] remove golbal css fixes #303
Unnati-Gupta24 Mar 13, 2025
3a4127b
[fix] Remove global CSS rules to avoid conflicts with downstream proj…
Unnati-Gupta24 Mar 18, 2025
1e7b863
[fix] Remove global CSS rules to avoid conflicts #303
Unnati-Gupta24 Mar 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions public/example_templates/netjson-clustering.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
<link href="../lib/css/netjsongraph-theme.css" rel="stylesheet" />
<link href="../lib/css/netjsongraph.css" rel="stylesheet" />
<style type="text/css">
html, body {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's avoid repeating this in each example. We can make a CSS file and store it in public/asstes/css/, should be doable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya I'm making a separate file for example specific stylings

margin: 0;
padding: 0;
height: 100%;
width: 100%;
}

#legend h4 {
margin: 10px 0;
text-align: center;
Expand Down Expand Up @@ -68,9 +75,13 @@
</style>
</head>
<body>
<div class="netjsongraph-container">
<div id="graphChartContainer"></div>
</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we shorten this a bit, eg?

Suggested change
<div class="netjsongraph-container">
<div id="graphChartContainer"></div>
</div>
<div id="njg">
</div>

The njg acronym stands for netjsongraph, it's already used elsewhere in the code.

<script type="text/javascript">
const map = new NetJSONGraph("../assets/data/netjsonmap.json", {
render: "map",
container: "#graphChartContainer",
clustering: true,
clusteringThreshold: 50,
// set map initial state.
Expand Down
12 changes: 12 additions & 0 deletions public/example_templates/netjson-dateParse.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
<link href="../lib/css/netjsongraph-theme.css" rel="stylesheet" />
<link href="../lib/css/netjsongraph.css" rel="stylesheet" />
<style>
html, body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}

.njg-date {
height: fit-content;
text-align: center;
Expand All @@ -23,6 +30,10 @@
</head>

<body>
<div class="netjsongraph-container">
<div id="graphChartContainer"></div>
</div>

<script type="text/javascript">
/*
The demo is used to show the use of the `dataParse` function.
Expand All @@ -31,6 +42,7 @@
*/
// `graph` render defaultly.
const graph = new NetJSONGraph("../assets/data/netjsonmap.json", {
container: "#graphChartContainer",
// Convert to internal json format,add `time` field.
prepareData: (data) => {
data.nodes.map((node) => {
Expand Down
12 changes: 12 additions & 0 deletions public/example_templates/netjson-multipleInterfaces.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,19 @@
<!-- theme can be easily customized via css -->
<link href="../lib/css/netjsongraph-theme.css" rel="stylesheet" />
<link href="../lib/css/netjsongraph.css" rel="stylesheet" />
<style>
html, body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<div class="netjsongraph-container">
<div id="graphChartContainer"></div>
</div>
<script type="text/javascript">
/*
The demo is used to show how to deal with the `multiple interfaces` in the NetJSON data.
Expand All @@ -20,6 +31,7 @@
const graph = new NetJSONGraph(
"../assets/data/netjson-multipleInterfaces.json",
{
container: "#graphChartContainer",
// Asynchronous processing of incoming data formats using WebWorker file.
dealDataByWorker: "../lib/js/netjsonWorker.js",
},
Expand Down
14 changes: 13 additions & 1 deletion public/example_templates/netjson-searchElements.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
<link href="../lib/css/netjsongraph-theme.css" rel="stylesheet" />
<link href="../lib/css/netjsongraph.css" rel="stylesheet" />
<style>
html, body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}

.njg-searchBtn {
border: none;
border-radius: 5px;
Expand Down Expand Up @@ -52,6 +59,10 @@
</head>

<body>
<div class="netjsongraph-container">
<div id="graphChartContainer"></div>
</div>

<script type="text/javascript">
/*
The demo is used to show the use of the `searchElements` function.
Expand All @@ -60,6 +71,7 @@
*/
// `graph` render defaultly.
let graph = new NetJSONGraph("../assets/data/netjsonmap.json", {
container: "#graphChartContainer",
onReady: function () {
let searchContainer = document.createElement("div"),
searchInput = document.createElement("input"),
Expand Down Expand Up @@ -109,4 +121,4 @@
graph.render();
</script>
</body>
</html>
</html>
14 changes: 13 additions & 1 deletion public/example_templates/netjson-switchGraphMode.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,31 @@
<link href="../lib/css/netjsongraph-theme.css" rel="stylesheet" />
<link href="../lib/css/netjsongraph.css" rel="stylesheet" />
<style type="text/css">
html, body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}

.leaflet-control-zoom {
top: 55px;
right: 1px;
}
</style>
</head>
<body>
<div class="netjsongraph-container">
<div id="graphChartContainer"></div>
</div>

<script type="text/javascript">
/*
The demo is used to show how to switch the netjsongraph render mode -- `graph` or `map`.
*/
const map = new NetJSONGraph("../assets/data/netjsonmap.json", {
render: "map",
container: "#graphChartContainer",
switchMode: true,
// set map initial state.
mapOptions: {
Expand All @@ -52,4 +64,4 @@
map.render();
</script>
</body>
</html>
</html>
16 changes: 14 additions & 2 deletions public/example_templates/netjson-switchRenderMode.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<title>netjsongraph.js: basic example</title>
Expand All @@ -8,6 +8,14 @@
<link href="../lib/css/netjsongraph-theme.css" rel="stylesheet" />
<link href="../lib/css/netjsongraph.css" rel="stylesheet" />
<style>
html,
body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}

.switch-wrap input[type="checkbox"] {
height: 0;
width: 0;
Expand All @@ -28,11 +36,15 @@
</head>

<body>
<div class="netjsongraph-container">
<div id="graphChartContainer"></div>
</div>
<script type="text/javascript">
/*
The demo is used to show how to switch the netjsongraph render mode -- `svg` or `canvas`.
*/
const graph = new NetJSONGraph("../assets/data/netjsonmap.json", {
container: "#graphChartContainer",
onReady: function () {
switchRenderMode(this);
},
Expand Down Expand Up @@ -91,4 +103,4 @@
}
</script>
</body>
</html>
</html>
31 changes: 16 additions & 15 deletions public/example_templates/netjsongraph-elementsLegend.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<link href="../lib/css/netjsongraph-theme.css" rel="stylesheet" />
<link href="../lib/css/netjsongraph.css" rel="stylesheet" />
<style>
#container {
width: 100%;
height: 100%;
overflow: hidden;
overflow-y: scroll;
}
html, body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}

#legend h4 {
margin: 10px 0;
Expand Down Expand Up @@ -85,21 +85,22 @@
}
</style>
</head>
<body>
<div id="legend">
<h4>Legends</h4>
<p><span class="circle node">&nbsp;</span> ordinary node</p>
<p><span class="circle gateway">&nbsp;</span> gateway node</p>
<p><span class="link wireless">&nbsp;</span> wireless link</p>
<p><span class="link ethernet">&nbsp;</span> ethernet link</p>
<div class="netjsongraph-container">
<div id="graphChartContainer"></div>
<div id="legend">
<h4>Legends</h4>
<p><span class="circle node">&nbsp;</span> ordinary node</p>
<p><span class="circle gateway">&nbsp;</span> gateway node</p>
<p><span class="link wireless">&nbsp;</span> wireless link</p>
<p><span class="link ethernet">&nbsp;</span> ethernet link</p>
</div>
</div>
<div id="container"></div>
<script type="text/javascript">
/*
The demo is used to show how to set colorful nodes.
*/
const graph = new NetJSONGraph("../assets/data/netjson-elementsLegend.json", {
el: "#container",
container: "#graphChartContainer",
graphConfig: {
series: {
force: {
Expand Down
12 changes: 12 additions & 0 deletions public/example_templates/netjsongraph-graphGL.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,19 @@
<!-- theme can be easily customized via css -->
<link href="../lib/css/netjsongraph-theme.css" rel="stylesheet" />
<link href="../lib/css/netjsongraph.css" rel="stylesheet" />
<style>
html, body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<div class="netjsongraph-container">
<div id="graphChartContainer"></div>
</div>
<script type="text/javascript">
/*
The demo is used to show how to use `graphGL` to render big data.
Expand All @@ -17,6 +28,7 @@
const graph = new NetJSONGraph(
"../assets/data/netjsongraph-graphGL.json",
{
container: "#graphChartContainer",
graphConfig: {
series: {
type: "graphGL",
Expand Down
14 changes: 13 additions & 1 deletion public/example_templates/netjsongraph-multipleLinks.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,20 @@
<!-- theme can be easily customized via css -->
<link href="../lib/css/netjsongraph-theme.css" rel="stylesheet" />
<link href="../lib/css/netjsongraph.css" rel="stylesheet" />
<style>
html, body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}
</style>
</head>

<body>
<div class="netjsongraph-container">
<div id="graphChartContainer"></div>
</div>
<script type="text/javascript">
/*
The demo is used to show the multiple links render.
Expand All @@ -19,6 +30,7 @@
const graph = new NetJSONGraph(
"../assets/data/netjsongraph-multipleLinks.json",
{
container: "#graphChartContainer",
graphConfig: {
// set force layout params
force: {
Expand All @@ -31,4 +43,4 @@
graph.render();
</script>
</body>
</html>
</html>
12 changes: 12 additions & 0 deletions public/example_templates/netjsongraph-nodeExpand.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,19 @@
<!-- theme can be easily customized via css -->
<link href="../lib/css/netjsongraph-theme.css" rel="stylesheet" />
<link href="../lib/css/netjsongraph.css" rel="stylesheet" />
<style>
html, body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<div class="netjsongraph-container">
<div id="graphChartContainer"></div>
</div>
<script type="text/javascript">
/*
The demo is used to show hwo to interact with elements.
Expand All @@ -17,6 +28,7 @@
const graph = new NetJSONGraph(
"../assets/data/netjsongraph-foldNodes.json",
{
container: "#graphChartContainer",
dealDataByWorker: "../lib/js/netjsonWorker.js",
echartsOption: {
legend: {
Expand Down
Loading