mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
Tidied up charts operations
This commit is contained in:
parent
f0b48acaf9
commit
1640859542
7 changed files with 16 additions and 14 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
import OperationError from "../errors/OperationError";
|
||||
|
||||
/**
|
||||
/**
|
||||
* @constant
|
||||
* @default
|
||||
*/
|
||||
|
@ -40,6 +40,7 @@ export const COLOURS = {
|
|||
* @param {string} recordDelimiter
|
||||
* @param {string} fieldDelimiter
|
||||
* @param {boolean} columnHeadingsAreIncluded - whether we should skip the first record
|
||||
* @param {number} length
|
||||
* @returns {Object[]}
|
||||
*/
|
||||
export function getValues(input, recordDelimiter, fieldDelimiter, columnHeadingsAreIncluded, length) {
|
||||
|
@ -58,7 +59,7 @@ export function getValues(input, recordDelimiter, fieldDelimiter, columnHeadings
|
|||
values.push(split);
|
||||
}
|
||||
});
|
||||
return { headings, values};
|
||||
return { headings, values };
|
||||
}
|
||||
|
||||
|
||||
|
@ -74,7 +75,8 @@ export function getValues(input, recordDelimiter, fieldDelimiter, columnHeadings
|
|||
export function getScatterValues(input, recordDelimiter, fieldDelimiter, columnHeadingsAreIncluded) {
|
||||
let { headings, values } = getValues(
|
||||
input,
|
||||
recordDelimiter, fieldDelimiter,
|
||||
recordDelimiter,
|
||||
fieldDelimiter,
|
||||
columnHeadingsAreIncluded,
|
||||
2
|
||||
);
|
||||
|
@ -96,6 +98,7 @@ export function getScatterValues(input, recordDelimiter, fieldDelimiter, columnH
|
|||
return { headings, values };
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets values from input for a scatter plot with colour from the third column.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue