2
0
mirror of https://github.com/gchq/CyberChef synced 2025-12-05 23:53:27 +00:00

Actually made operations work (and made the module 8MB)

Unfortunately they need jsdom
This commit is contained in:
Matt
2019-03-10 11:44:02 +00:00
parent 4ae875601a
commit f8874fc586
8 changed files with 211 additions and 201 deletions

View File

@@ -5,6 +5,7 @@
*/
import * as d3 from "d3";
import jsdom from "jsdom";
import { getSeriesValues, RECORD_DELIMITER_OPTIONS, FIELD_DELIMITER_OPTIONS } from "../lib/Charts";
import Operation from "../Operation";
@@ -62,8 +63,8 @@ class SeriesChart extends Operation {
* @returns {html}
*/
run(input, args) {
const recordDelimiter = Utils.charRep[args[0]],
fieldDelimiter = Utils.charRep[args[1]],
const recordDelimiter = Utils.charRep(args[0]),
fieldDelimiter = Utils.charRep(args[1]),
xLabel = args[2],
pipRadius = args[3],
seriesColours = args[4].split(","),
@@ -78,6 +79,7 @@ class SeriesChart extends Operation {
allSeriesHeight = Object.keys(series).length * (interSeriesPadding + seriesHeight),
svgHeight = allSeriesHeight + xAxisHeight + interSeriesPadding;
const document = new jsdom.JSDOM().window.document;
let svg = document.createElement("svg");
svg = d3.select(svg)
.attr("width", "100%")