Skip to content

Commit 0019a4e

Browse files
committed
Found a different dom implementation that removes 6MB
1 parent f8874fc commit 0019a4e

File tree

6 files changed

+14
-8
lines changed

6 files changed

+14
-8
lines changed

package-lock.json

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

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
"ngeohash": "^0.6.3",
122122
"node-forge": "^0.7.6",
123123
"node-md6": "^0.1.0",
124+
"nodom": "github:ptytb/nodom",
124125
"notepack.io": "^2.2.0",
125126
"nwmatcher": "^1.4.4",
126127
"otp": "^0.1.3",

src/core/operations/HeatmapChart.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import * as d3 from "d3";
8-
import jsdom from "jsdom";
8+
import * as nodom from "nodom";
99
import { getScatterValues, RECORD_DELIMITER_OPTIONS, COLOURS, FIELD_DELIMITER_OPTIONS } from "../lib/Charts";
1010

1111

@@ -117,7 +117,7 @@ class HeatmapChart extends Operation {
117117
yLabel = headings.y;
118118
}
119119

120-
const document = new jsdom.JSDOM().window.document;
120+
const document = new nodom.Document();
121121
let svg = document.createElement("svg");
122122
svg = d3.select(svg)
123123
.attr("width", "100%")

src/core/operations/HexDensityChart.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import * as d3 from "d3";
88
import * as d3hexbin from "d3-hexbin";
9-
import jsdom from "jsdom";
9+
import * as nodom from "nodom";
1010
import { getScatterValues, RECORD_DELIMITER_OPTIONS, COLOURS, FIELD_DELIMITER_OPTIONS } from "../lib/Charts";
1111

1212
import Operation from "../Operation";
@@ -120,7 +120,7 @@ class HexDensityChart extends Operation {
120120
yLabel = headings.y;
121121
}
122122

123-
const document = new jsdom.JSDOM().window.document;
123+
const document = new nodom.Document();
124124
let svg = document.createElement("svg");
125125
svg = d3.select(svg)
126126
.attr("width", "100%")

src/core/operations/ScatterChart.mjs

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import * as d3 from "d3";
8-
import jsdom from "jsdom";
8+
import * as nodom from "nodom";
99
import { getScatterValues, getScatterValuesWithColour, RECORD_DELIMITER_OPTIONS, COLOURS, FIELD_DELIMITER_OPTIONS } from "../lib/Charts";
1010

1111
import Operation from "../Operation";
@@ -101,7 +101,8 @@ class ScatterChart extends Operation {
101101
xLabel = headings.x;
102102
yLabel = headings.y;
103103
}
104-
const document = new jsdom.JSDOM().window.document;
104+
105+
const document = new nodom.Document();
105106
let svg = document.createElement("svg");
106107
svg = d3.select(svg)
107108
.attr("width", "100%")

src/core/operations/SeriesChart.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import * as d3 from "d3";
8-
import jsdom from "jsdom";
8+
import * as nodom from "nodom";
99
import { getSeriesValues, RECORD_DELIMITER_OPTIONS, FIELD_DELIMITER_OPTIONS } from "../lib/Charts";
1010

1111
import Operation from "../Operation";
@@ -79,7 +79,7 @@ class SeriesChart extends Operation {
7979
allSeriesHeight = Object.keys(series).length * (interSeriesPadding + seriesHeight),
8080
svgHeight = allSeriesHeight + xAxisHeight + interSeriesPadding;
8181

82-
const document = new jsdom.JSDOM().window.document;
82+
const document = new nodom.Document();
8383
let svg = document.createElement("svg");
8484
svg = d3.select(svg)
8585
.attr("width", "100%")

0 commit comments

Comments
 (0)