@hpcc-js/chart
Advanced tools
Comparing version 2.84.1 to 2.85.0
{ | ||
"name": "@hpcc-js/chart", | ||
"version": "2.84.1", | ||
"version": "2.85.0", | ||
"description": "hpcc-js - Viz Chart", | ||
@@ -82,3 +82,3 @@ "main": "dist/index.js", | ||
"homepage": "https://github.com/hpcc-systems/Visualization", | ||
"gitHead": "ac825f8d94e3b16ecb4cf74fa92bba3ea7a84ae4" | ||
"gitHead": "9e1dd990858b6fb5dd0e46425def23c9609c147a" | ||
} |
export const PKG_NAME = "@hpcc-js/chart"; | ||
export const PKG_VERSION = "2.84.1"; | ||
export const BUILD_VERSION = "2.106.1"; | ||
export const PKG_VERSION = "2.85.0"; | ||
export const BUILD_VERSION = "2.106.4"; |
@@ -1,3 +0,3 @@ | ||
export { Test } from "./stat"; | ||
export { Test } from "./pie"; | ||
// export { Test3 as Test } from "./test3"; | ||
// export { StdDevTest as Test } from "./heat"; |
@@ -11,2 +11,5 @@ import { I2DChart, ITooltip } from "@hpcc-js/api"; | ||
const sortAscending = (a, b) => a[1] - b[1] > 0 ? 1 : -1; | ||
const sortDescending = (a, b) => a[1] - b[1] > 0 ? -1 : 1; | ||
export class Pie extends SVGWidget { | ||
@@ -190,5 +193,11 @@ static __inputs: InputField[] = [{ | ||
this._quadIdxArr = [[], [], [], []]; | ||
const data = [...this.data()].sort((a, b) => { | ||
return a[1] - b[1] > 0 ? -1 : 1; | ||
}); | ||
const data = [...this.data()]; | ||
switch (this.sortDataByValue()) { | ||
case "ascending": | ||
data.sort(sortAscending); | ||
break; | ||
case "descending": | ||
data.sort(sortDescending); | ||
break; | ||
} | ||
const arc = this._slices.selectAll(".arc").data(this.d3Pie(data), d => d.data[0]); | ||
@@ -412,2 +421,14 @@ | ||
const startAngle = normalizeRadians(degreesToRadians(this.startAngle())); | ||
switch (this.sortDataByValue()) { | ||
case "ascending": | ||
this.d3Pie.sort(sortAscending); | ||
break; | ||
case "descending": | ||
this.d3Pie.sort(sortDescending); | ||
break; | ||
default: | ||
this.d3Pie.sort(null); | ||
} | ||
this.d3Pie | ||
@@ -417,5 +438,2 @@ .padAngle(0.0025) | ||
.endAngle(2 * Math.PI + startAngle) | ||
.sort(function (b, a) { | ||
return a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0; | ||
}) | ||
.value(function (d) { | ||
@@ -475,2 +493,4 @@ return d[1]; | ||
showLabels(_: boolean): this; | ||
sortDataByValue(): "none" | "ascending" | "descending"; | ||
sortDataByValue(_: "none" | "ascending" | "descending"): this; | ||
} | ||
@@ -488,1 +508,2 @@ Pie.prototype.publish("showLabels", true, "boolean", "If true, wedge labels will display"); | ||
Pie.prototype.publish("labelHeight", 12, "number", "Font size of labels (pixels)", null, { disable: w => !w.showLabels() }); | ||
Pie.prototype.publish("sortDataByValue", "descending", "set", "Sort data by value", ["none", "ascending", "descending"]); |
export declare const PKG_NAME = "@hpcc-js/chart"; | ||
export declare const PKG_VERSION = "2.84.1"; | ||
export declare const BUILD_VERSION = "2.106.1"; | ||
export declare const PKG_VERSION = "2.85.0"; | ||
export declare const BUILD_VERSION = "2.106.4"; | ||
//# sourceMappingURL=__package__.d.ts.map |
@@ -1,2 +0,2 @@ | ||
export { Test } from "./stat"; | ||
export { Test } from "./pie"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -92,3 +92,5 @@ import { InputField, SVGWidget, Utility } from "@hpcc-js/common"; | ||
showLabels(_: boolean): this; | ||
sortDataByValue(): "none" | "ascending" | "descending"; | ||
sortDataByValue(_: "none" | "ascending" | "descending"): this; | ||
} | ||
//# sourceMappingURL=Pie.d.ts.map |
export declare const PKG_NAME = "@hpcc-js/chart"; | ||
export declare const PKG_VERSION = "2.84.1"; | ||
export declare const BUILD_VERSION = "2.106.1"; | ||
export declare const PKG_VERSION = "2.85.0"; | ||
export declare const BUILD_VERSION = "2.106.4"; | ||
//# sourceMappingURL=__package__.d.ts.map |
@@ -1,2 +0,2 @@ | ||
export { Test } from "./stat"; | ||
export { Test } from "./pie"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -92,3 +92,5 @@ import { InputField, SVGWidget, Utility } from "@hpcc-js/common"; | ||
showLabels(_: boolean): this; | ||
sortDataByValue(): "none" | "ascending" | "descending"; | ||
sortDataByValue(_: "none" | "ascending" | "descending"): this; | ||
} | ||
//# sourceMappingURL=Pie.d.ts.map |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4415711
186
32061