@hpcc-js/chart 3.6.3 → 3.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +43 -43
- package/README.md +93 -93
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +6 -6
- package/src/Area.md +176 -176
- package/src/Area.ts +12 -12
- package/src/Axis.css +34 -34
- package/src/Axis.ts +781 -781
- package/src/Bar.md +90 -90
- package/src/Bar.ts +9 -9
- package/src/Bubble.css +16 -16
- package/src/Bubble.md +69 -69
- package/src/Bubble.ts +196 -196
- package/src/BubbleXY.ts +14 -14
- package/src/Bullet.css +60 -60
- package/src/Bullet.md +104 -104
- package/src/Bullet.ts +176 -176
- package/src/Column.css +44 -44
- package/src/Column.md +90 -90
- package/src/Column.ts +684 -684
- package/src/Contour.md +88 -88
- package/src/Contour.ts +97 -97
- package/src/D3Cloud.ts +403 -403
- package/src/Gantt.md +119 -119
- package/src/Gantt.ts +14 -14
- package/src/Gauge.md +148 -148
- package/src/Gauge.ts +368 -368
- package/src/HalfPie.md +62 -62
- package/src/HalfPie.ts +26 -26
- package/src/Heat.md +42 -42
- package/src/Heat.ts +283 -283
- package/src/HexBin.css +9 -9
- package/src/HexBin.md +88 -88
- package/src/HexBin.ts +144 -144
- package/src/Line.css +6 -6
- package/src/Line.md +170 -170
- package/src/Line.ts +14 -14
- package/src/Pie.css +50 -50
- package/src/Pie.md +88 -88
- package/src/Pie.ts +546 -546
- package/src/QuarterPie.md +61 -61
- package/src/QuarterPie.ts +35 -35
- package/src/QuartileCandlestick.md +129 -129
- package/src/QuartileCandlestick.ts +349 -349
- package/src/Radar.css +15 -15
- package/src/Radar.md +104 -104
- package/src/Radar.ts +336 -336
- package/src/RadialBar.css +25 -25
- package/src/RadialBar.md +91 -91
- package/src/RadialBar.ts +217 -217
- package/src/Scatter.css +42 -42
- package/src/Scatter.md +163 -163
- package/src/Scatter.ts +412 -412
- package/src/StatChart.md +117 -117
- package/src/StatChart.ts +261 -261
- package/src/Step.md +163 -163
- package/src/Step.ts +12 -12
- package/src/Summary.css +56 -56
- package/src/Summary.md +219 -219
- package/src/Summary.ts +322 -322
- package/src/SummaryC.md +154 -154
- package/src/SummaryC.ts +240 -240
- package/src/WordCloud.css +3 -3
- package/src/WordCloud.md +144 -144
- package/src/WordCloud.ts +268 -268
- package/src/XYAxis.css +41 -41
- package/src/XYAxis.md +149 -149
- package/src/XYAxis.ts +809 -809
- package/src/__package__.ts +3 -3
- package/src/__tests__/heat.ts +71 -71
- package/src/__tests__/index.ts +3 -3
- package/src/__tests__/pie.ts +20 -20
- package/src/__tests__/stat.ts +16 -16
- package/src/__tests__/test3.ts +68 -68
- package/src/index.ts +28 -28
- package/src/test.ts +70 -70
- package/src/timeFormats.ts +26 -26
package/src/timeFormats.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { timeFormat } from "d3-time-format";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Adaptive 24-hour multi-scale tick formatter.
|
|
5
|
-
* Order of precedence (first predicate that matches):
|
|
6
|
-
* milliseconds -> seconds -> minutes -> hours -> day -> month -> year.
|
|
7
|
-
*/
|
|
8
|
-
export function multiScale24Hours(): (d: Date) => string {
|
|
9
|
-
const fmtMs = timeFormat(".%L");
|
|
10
|
-
const fmtSec = timeFormat(":%S");
|
|
11
|
-
const fmtMin = timeFormat("%H:%M");
|
|
12
|
-
const fmtHour = timeFormat("%H:00");
|
|
13
|
-
const fmtDay = timeFormat("%b %d");
|
|
14
|
-
const fmtMonth = timeFormat("%b");
|
|
15
|
-
const fmtYear = timeFormat("%Y");
|
|
16
|
-
|
|
17
|
-
return (d: Date): string => {
|
|
18
|
-
if (d.getMilliseconds() !== 0) return fmtMs(d);
|
|
19
|
-
if (d.getSeconds() !== 0) return fmtSec(d);
|
|
20
|
-
if (d.getMinutes() !== 0) return fmtMin(d);
|
|
21
|
-
if (d.getHours() !== 0) return fmtHour(d);
|
|
22
|
-
if (d.getDate() !== 1) return fmtDay(d);
|
|
23
|
-
if (d.getMonth() !== 0) return fmtMonth(d);
|
|
24
|
-
return fmtYear(d);
|
|
25
|
-
};
|
|
26
|
-
}
|
|
1
|
+
import { timeFormat } from "d3-time-format";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Adaptive 24-hour multi-scale tick formatter.
|
|
5
|
+
* Order of precedence (first predicate that matches):
|
|
6
|
+
* milliseconds -> seconds -> minutes -> hours -> day -> month -> year.
|
|
7
|
+
*/
|
|
8
|
+
export function multiScale24Hours(): (d: Date) => string {
|
|
9
|
+
const fmtMs = timeFormat(".%L");
|
|
10
|
+
const fmtSec = timeFormat(":%S");
|
|
11
|
+
const fmtMin = timeFormat("%H:%M");
|
|
12
|
+
const fmtHour = timeFormat("%H:00");
|
|
13
|
+
const fmtDay = timeFormat("%b %d");
|
|
14
|
+
const fmtMonth = timeFormat("%b");
|
|
15
|
+
const fmtYear = timeFormat("%Y");
|
|
16
|
+
|
|
17
|
+
return (d: Date): string => {
|
|
18
|
+
if (d.getMilliseconds() !== 0) return fmtMs(d);
|
|
19
|
+
if (d.getSeconds() !== 0) return fmtSec(d);
|
|
20
|
+
if (d.getMinutes() !== 0) return fmtMin(d);
|
|
21
|
+
if (d.getHours() !== 0) return fmtHour(d);
|
|
22
|
+
if (d.getDate() !== 1) return fmtDay(d);
|
|
23
|
+
if (d.getMonth() !== 0) return fmtMonth(d);
|
|
24
|
+
return fmtYear(d);
|
|
25
|
+
};
|
|
26
|
+
}
|