@mstone6969/graph 0.1.0 → 0.2.0
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/README.md +111 -14
- package/dist/ExcelWriter-3ZSYUH4T.cjs +154 -0
- package/dist/GraphType.js +24 -38
- package/dist/PdfWriter-6HJFYMCO.cjs +205 -0
- package/dist/catalog-YWX6FHRM.cjs +8 -0
- package/dist/catalog.js +5 -1
- package/dist/charts/bars/index.js +2 -12
- package/dist/charts/comparison/EffectForestPlot.js +1 -1
- package/dist/charts/comparison/index.js +1 -8
- package/dist/charts/demography/Nomogram.js +3 -3
- package/dist/charts/density/HexbinChart.js +6 -4
- package/dist/charts/diagrams/ArchitectureCanvas.js +68 -0
- package/dist/charts/diagrams/ArchitectureDiagram.js +331 -0
- package/dist/charts/diagrams/ArchitectureLayout.js +106 -0
- package/dist/charts/diagrams/ArchitectureLinkLabels.js +78 -0
- package/dist/charts/diagrams/ArchitectureModel.js +108 -0
- package/dist/charts/diagrams/ArchitectureRouter.js +348 -0
- package/dist/charts/diagrams/ArchitectureSamples.js +312 -0
- package/dist/charts/diagrams/ArchitectureShapes.js +130 -0
- package/dist/charts/diagrams/ArchitectureText.js +25 -0
- package/dist/charts/diagrams/DiagramText.js +38 -0
- package/dist/charts/diagrams/EntityRelationshipDiagram.js +465 -0
- package/dist/charts/diagrams/ErCrowsFoot.js +33 -0
- package/dist/charts/diagrams/ErSamples.js +205 -0
- package/dist/charts/diagrams/ErSchema.js +122 -0
- package/dist/charts/diagrams/LogicCircuit.js +154 -0
- package/dist/charts/diagrams/LogicCircuitLayout.js +600 -0
- package/dist/charts/diagrams/LogicCircuitSamples.js +66 -0
- package/dist/charts/diagrams/LogicGateDiagram.js +216 -0
- package/dist/charts/diagrams/LogicGateSymbol.js +113 -0
- package/dist/charts/diagrams/NetworkTopologyDiagram.js +247 -0
- package/dist/charts/diagrams/SequenceDiagram.js +351 -0
- package/dist/charts/diagrams/SequenceLayout.js +422 -0
- package/dist/charts/diagrams/SequenceModel.js +221 -0
- package/dist/charts/diagrams/TopologyLayout.js +143 -0
- package/dist/charts/diagrams/architectureEnums.js +50 -0
- package/dist/charts/diagrams/index.js +26 -0
- package/dist/charts/diagrams/logicEnums.js +42 -0
- package/dist/charts/diagrams/sequenceEnums.js +40 -0
- package/dist/charts/distribution/HistogramChart.js +25 -3
- package/dist/charts/distribution/index.js +1 -3
- package/dist/charts/earthscience/HovmollerDiagram.js +477 -0
- package/dist/charts/earthscience/HovmollerEnums.js +42 -0
- package/dist/charts/earthscience/HovmollerField.js +180 -0
- package/dist/charts/earthscience/HovmollerSample.js +40 -0
- package/dist/charts/earthscience/HovmollerSpeed.js +71 -0
- package/dist/charts/earthscience/index.js +10 -2
- package/dist/charts/engineering/ConstellationDiagram.js +26 -6
- package/dist/charts/engineering/EyeDiagram.js +2 -1
- package/dist/charts/engineering/PoleZeroPlot.js +32 -8
- package/dist/charts/financial/RelativeStrengthRotation.js +434 -0
- package/dist/charts/financial/RelativeStrengthRotationMath.js +71 -0
- package/dist/charts/financial/RelativeStrengthRotationSamples.js +27 -0
- package/dist/charts/financial/index.js +5 -3
- package/dist/charts/flow/index.js +1 -5
- package/dist/charts/frameworks/AnsoffMatrix.js +523 -0
- package/dist/charts/frameworks/FrameworkText.js +98 -0
- package/dist/charts/frameworks/NpsGauge.js +279 -0
- package/dist/charts/frameworks/NpsSurvey.js +58 -0
- package/dist/charts/frameworks/PerceptualMap.js +419 -0
- package/dist/charts/frameworks/PerceptualProjection.js +142 -0
- package/dist/charts/frameworks/PositioningSamples.js +191 -0
- package/dist/charts/frameworks/RaciMatrix.js +458 -0
- package/dist/charts/frameworks/RaciPlan.js +81 -0
- package/dist/charts/frameworks/RaciSamples.js +76 -0
- package/dist/charts/frameworks/SwotMatrix.js +358 -0
- package/dist/charts/frameworks/SwotSamples.js +85 -0
- package/dist/charts/frameworks/VanWestendorpChart.js +187 -0
- package/dist/charts/frameworks/VanWestendorpSurvey.js +197 -0
- package/dist/charts/frameworks/index.js +26 -0
- package/dist/charts/frameworks/raciEnums.js +30 -0
- package/dist/charts/frameworks/swotEnums.js +34 -0
- package/dist/charts/genomics/CircosPlot.js +1 -1
- package/dist/charts/geoflows/GeoFlowChart.js +2 -2
- package/dist/charts/geoflows/GeoFlowSample.js +2 -1
- package/dist/charts/geomaps/FloorPlanMap.js +324 -0
- package/dist/charts/geomaps/FloorPlanModel.js +179 -0
- package/dist/charts/geomaps/FloorPlanSamples.js +416 -0
- package/dist/charts/geomaps/GeoLand.js +2 -2
- package/dist/charts/geomaps/GeoSamples.js +2 -1
- package/dist/charts/geomaps/GraticuleMap.js +2 -2
- package/dist/charts/geomaps/RoomLabelFit.js +200 -0
- package/dist/charts/geomaps/TissotMap.js +2 -2
- package/dist/charts/geomaps/index.js +8 -4
- package/dist/charts/hierarchy/SunburstChart.js +17 -10
- package/dist/charts/hierarchy/index.js +2 -11
- package/dist/charts/indicators/BulletChart.js +8 -2
- package/dist/charts/indicators/SpeedometerChart.js +1 -1
- package/dist/charts/indicators/ThermometerChart.js +1 -1
- package/dist/charts/lifescience/LoessFit.js +113 -0
- package/dist/charts/lifescience/MaPlot.js +337 -0
- package/dist/charts/lifescience/MaPlotSamples.js +35 -0
- package/dist/charts/lifescience/OncoGlyph.js +137 -0
- package/dist/charts/lifescience/OncoPrint.js +373 -0
- package/dist/charts/lifescience/OncoPrintMatrix.js +107 -0
- package/dist/charts/lifescience/OncoPrintSamples.js +142 -0
- package/dist/charts/lifescience/PedigreeChart.js +306 -0
- package/dist/charts/lifescience/PedigreeLayout.js +261 -0
- package/dist/charts/lifescience/PedigreeRows.js +70 -0
- package/dist/charts/lifescience/PedigreeSamples.js +161 -0
- package/dist/charts/lifescience/PedigreeSymbol.js +47 -0
- package/dist/charts/lifescience/RamachandranPlot.js +364 -0
- package/dist/charts/lifescience/RamachandranRegions.js +2712 -0
- package/dist/charts/lifescience/RamachandranSamples.js +235 -0
- package/dist/charts/lifescience/index.js +25 -0
- package/dist/charts/lifescience/pedigreeEnums.js +21 -0
- package/dist/charts/lifescience/ramachandranEnums.js +34 -0
- package/dist/charts/linesareas/DualAxisChart.js +1 -1
- package/dist/charts/linesareas/LineEnums.js +1 -15
- package/dist/charts/linesareas/MultiLineChart.js +1 -1
- package/dist/charts/linesareas/TrendChart.js +15 -5
- package/dist/charts/linesareas/index.js +2 -6
- package/dist/charts/massive/MassiveChart.js +3 -2
- package/dist/charts/mathematical/FourierSeriesChart.js +7 -1
- package/dist/charts/mathematical/index.js +2 -6
- package/dist/charts/matrix/GridPlot.js +27 -2
- package/dist/charts/matrix/TilegramChart.js +2 -2
- package/dist/charts/mlcharts/AttentionGrid.js +79 -0
- package/dist/charts/mlcharts/AttentionHeatmap.js +329 -0
- package/dist/charts/mlcharts/AttentionModel.js +132 -0
- package/dist/charts/mlcharts/AttentionSamples.js +82 -0
- package/dist/charts/mlcharts/CellNumber.js +8 -0
- package/dist/charts/mlcharts/CurveDiagnosticSamples.js +95 -0
- package/dist/charts/mlcharts/CurvePickMark.js +31 -0
- package/dist/charts/mlcharts/DecisionBoundaryChart.js +316 -0
- package/dist/charts/mlcharts/DecisionSamples.js +60 -0
- package/dist/charts/mlcharts/DecisionSurface.js +130 -0
- package/dist/charts/mlcharts/DistinctTicks.js +13 -0
- package/dist/charts/mlcharts/ElbowMath.js +153 -0
- package/dist/charts/mlcharts/ElbowPlot.js +273 -0
- package/dist/charts/mlcharts/ExplainabilitySamples.js +70 -0
- package/dist/charts/mlcharts/FeatureImportanceChart.js +150 -0
- package/dist/charts/mlcharts/ImportanceRanking.js +98 -0
- package/dist/charts/mlcharts/LearningCurveChart.js +276 -0
- package/dist/charts/mlcharts/LearningCurveMath.js +92 -0
- package/dist/charts/mlcharts/PartialDependence.js +92 -0
- package/dist/charts/mlcharts/PartialDependencePlot.js +225 -0
- package/dist/charts/mlcharts/WideLabel.js +28 -0
- package/dist/charts/mlcharts/curveDiagnosticEnums.js +37 -0
- package/dist/charts/mlcharts/index.js +32 -0
- package/dist/charts/proportion/index.js +5 -9
- package/dist/charts/scatter/CategoryScatterBase.js +1 -4
- package/dist/charts/scatter/ConnectedScatter.js +7 -4
- package/dist/charts/scatter/MarginalScatter.js +13 -8
- package/dist/charts/scatter/index.js +4 -17
- package/dist/charts/scientific/SpectrogramChart.js +9 -3
- package/dist/charts/scientific/index.js +2 -2
- package/dist/charts/signals/index.js +3 -13
- package/dist/charts/statistics/LorenzCurve.js +7 -4
- package/dist/charts/threebars/Candlestick3DChart.js +18 -2
- package/dist/charts/threeglobe/GlobeChart.js +2 -2
- package/dist/charts/threeglobe/GlobeSamples.js +2 -1
- package/dist/charts/threeglobe/RingGlobe.js +1 -1
- package/dist/charts/threenetwork/ConeTreeChart.js +2 -1
- package/dist/charts/threenetwork/Gantt3DChart.js +3 -2
- package/dist/charts/threesurfaces/Ridgeline3DChart.js +22 -4
- package/dist/charts/threevolume/LorenzAttractor.js +19 -0
- package/dist/charts/threevolume/VolumeRaycastChart.js +4 -3
- package/dist/charts/threevolume/volumeEnums.js +1 -0
- package/dist/charts/timeline/index.js +2 -10
- package/dist/chunk-753UBLV2.cjs +33 -0
- package/dist/chunk-VX54A7KA.cjs +17 -0
- package/dist/{chunk-W5GAAAZY.cjs → chunk-WAODDPYX.cjs} +24874 -17620
- package/dist/chunk-Z3JPIJSC.cjs +338 -0
- package/dist/core/CartesianChart.js +87 -11
- package/dist/core/Chart.js +63 -15
- package/dist/core/Chart2D.js +54 -17
- package/dist/core/Chart3D.js +56 -20
- package/dist/core/ChartExportError.js +2 -0
- package/dist/core/ChartExporter.js +50 -8
- package/dist/core/ColumnCheck.js +53 -0
- package/dist/core/Context2D.js +29 -15
- package/dist/core/Context3D.js +7 -2
- package/dist/core/ExcelWriter.js +152 -0
- package/dist/core/ExportText.js +28 -0
- package/dist/core/MarkOrigin.js +88 -0
- package/dist/core/MarkStyle.js +294 -0
- package/dist/core/Palette.js +27 -7
- package/dist/core/PdfPage.js +13 -0
- package/dist/core/PdfWriter.js +245 -0
- package/dist/core/Scales.js +52 -2
- package/dist/core/SceneOverlay.js +4 -4
- package/dist/core/TextFit.js +37 -0
- package/dist/core/Theme.js +28 -1
- package/dist/core/enums.js +33 -1
- package/dist/core/pathMorph.js +15 -0
- package/dist/data/SampleData.js +1 -17
- package/dist/data/WorldSample.js +23 -0
- package/dist/index.cjs +810 -691
- package/dist/index.d.cts +8390 -2925
- package/dist/index.d.ts +8392 -2927
- package/dist/index.js +106 -56
- package/dist/react/ChartView.js +18 -8
- package/dist/react/GraphHandle.js +2 -0
- package/dist/react/components.js +74 -116
- package/package.json +13 -3
- package/dist/catalog-4UP2YFNR.cjs +0 -7
- package/dist/charts/bars/BulletBar.js +0 -184
- package/dist/charts/bars/ErrorBarColumn.js +0 -147
- package/dist/charts/bars/HistogramBar.js +0 -217
- package/dist/charts/bars/MarimekkoBar.js +0 -191
- package/dist/charts/bars/ParetoBar.js +0 -143
- package/dist/charts/comparison/PanelChart.js +0 -70
- package/dist/charts/comparison/SmallMultipleBars.js +0 -134
- package/dist/charts/comparison/SpanChart.js +0 -118
- package/dist/charts/comparison/TrellisChart.js +0 -158
- package/dist/charts/distribution/RidgeSlabs3DChart.js +0 -169
- package/dist/charts/financial/Candlestick3D.js +0 -157
- package/dist/charts/flow/BumpFlow.js +0 -212
- package/dist/charts/flow/StreamFlow.js +0 -174
- package/dist/charts/geomaps/ThiessenMap.js +0 -106
- package/dist/charts/hierarchy/ConeTree3D.js +0 -135
- package/dist/charts/hierarchy/Hierarchy3DChart.js +0 -27
- package/dist/charts/hierarchy/SpherePack3D.js +0 -81
- package/dist/charts/hierarchy/SunburstTower3D.js +0 -93
- package/dist/charts/hierarchy/TreemapSkyline3D.js +0 -98
- package/dist/charts/linesareas/ConnectedScatterTime.js +0 -206
- package/dist/charts/linesareas/SmallMultipleLines.js +0 -153
- package/dist/charts/mathematical/ParametricSurface3D.js +0 -234
- package/dist/charts/mathematical/StrangeAttractor3D.js +0 -251
- package/dist/charts/proportion/ConeFunnel.js +0 -126
- package/dist/charts/proportion/ExtrudedPieChart.js +0 -123
- package/dist/charts/scatter/BeeswarmScatter.js +0 -151
- package/dist/charts/scatter/BinnedScatterBase.js +0 -51
- package/dist/charts/scatter/ContourScatter.js +0 -116
- package/dist/charts/scatter/GridBinScatter.js +0 -98
- package/dist/charts/scatter/HexbinScatter.js +0 -74
- package/dist/charts/scatter/StripScatter.js +0 -107
- package/dist/charts/scatter/SunflowerScatter.js +0 -109
- package/dist/charts/signals/ConstellationChart.js +0 -153
- package/dist/charts/signals/CorrelogramChart.js +0 -171
- package/dist/charts/signals/EyeDiagramChart.js +0 -155
- package/dist/charts/signals/PoleZeroChart.js +0 -164
- package/dist/charts/signals/SpectrogramChart.js +0 -79
- package/dist/charts/timeline/CalendarSkylineChart.js +0 -128
- package/dist/charts/timeline/ScheduleBlocksChart.js +0 -119
- package/dist/charts/timeline/SpiralTimeline.js +0 -154
- package/dist/charts/timeline/StreamTimeline.js +0 -141
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// src/charts/mlcharts/WideLabel.ts
|
|
2
|
+
var CHAR = 6.2;
|
|
3
|
+
/** East Asian text fills a full em against 0.56 em for a Latin letter, and colour emoji about 1.5 em in WebKit. */
|
|
4
|
+
var FULL_WIDTH = 1.8;
|
|
5
|
+
var EMOJI_WIDTH = 2.8;
|
|
6
|
+
var WIDE = /[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul} -〿-⦆]/u;
|
|
7
|
+
var EMOJI = /\p{Extended_Pictographic}/u;
|
|
8
|
+
var segmenter = new Intl.Segmenter();
|
|
9
|
+
var graphemes = (text) => Array.from(segmenter.segment(text), ({ segment }) => segment);
|
|
10
|
+
var cost = (glyph, char) => EMOJI.test(glyph) ? char * EMOJI_WIDTH : WIDE.test(glyph) ? char * FULL_WIDTH : char;
|
|
11
|
+
/** Estimates and truncates labels by what they occupy, so CJK fits its room and an emoji is never cut in half. */
|
|
12
|
+
var WideLabel = class {
|
|
13
|
+
static width(text, char = CHAR) {
|
|
14
|
+
return graphemes(text).reduce((total, glyph) => total + cost(glyph, char), 0);
|
|
15
|
+
}
|
|
16
|
+
/** The label, or as much as fits in `width` px with an ellipsis, or nothing when not even one character does. */
|
|
17
|
+
static fit(text, width, char = CHAR) {
|
|
18
|
+
if (this.width(text, char) <= width) return text;
|
|
19
|
+
let used = char, kept = "";
|
|
20
|
+
for (const glyph of graphemes(text)) {
|
|
21
|
+
used += cost(glyph, char);
|
|
22
|
+
if (used > width) break;
|
|
23
|
+
kept += glyph;
|
|
24
|
+
}
|
|
25
|
+
return kept ? `${kept}…` : "";
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
export { WideLabel };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// src/charts/mlcharts/curveDiagnosticEnums.ts
|
|
2
|
+
/** Whether a lower or a higher metric is better: loss against accuracy. */
|
|
3
|
+
var MetricGoal = /* @__PURE__ */ function(MetricGoal) {
|
|
4
|
+
MetricGoal["Minimize"] = "minimize";
|
|
5
|
+
MetricGoal["Maximize"] = "maximize";
|
|
6
|
+
return MetricGoal;
|
|
7
|
+
}({});
|
|
8
|
+
/** Band drawn around the mean across runs. */
|
|
9
|
+
var RunSpread = /* @__PURE__ */ function(RunSpread) {
|
|
10
|
+
RunSpread["StandardDeviation"] = "std-dev";
|
|
11
|
+
RunSpread["Confidence95"] = "ci-95";
|
|
12
|
+
RunSpread["Range"] = "min-max";
|
|
13
|
+
return RunSpread;
|
|
14
|
+
}({});
|
|
15
|
+
/** Which part of the train-to-validation gap is shaded. */
|
|
16
|
+
var OverfitShading = /* @__PURE__ */ function(OverfitShading) {
|
|
17
|
+
OverfitShading["None"] = "no-gap";
|
|
18
|
+
OverfitShading["Generalization"] = "generalization-gap";
|
|
19
|
+
OverfitShading["AfterBest"] = "after-best-epoch";
|
|
20
|
+
return OverfitShading;
|
|
21
|
+
}({});
|
|
22
|
+
/** Rule that picks the elbow of a score-by-k curve. */
|
|
23
|
+
var ElbowMethod = /* @__PURE__ */ function(ElbowMethod) {
|
|
24
|
+
ElbowMethod["Kneedle"] = "kneedle";
|
|
25
|
+
ElbowMethod["LMethod"] = "l-method";
|
|
26
|
+
ElbowMethod["Chord"] = "max-chord-distance";
|
|
27
|
+
ElbowMethod["SecondDifference"] = "second-difference";
|
|
28
|
+
return ElbowMethod;
|
|
29
|
+
}({});
|
|
30
|
+
/** Where the silhouette score is drawn against the same k. */
|
|
31
|
+
var SilhouetteView = /* @__PURE__ */ function(SilhouetteView) {
|
|
32
|
+
SilhouetteView["None"] = "no-silhouette";
|
|
33
|
+
SilhouetteView["SecondAxis"] = "second-axis";
|
|
34
|
+
SilhouetteView["Panel"] = "lower-panel";
|
|
35
|
+
return SilhouetteView;
|
|
36
|
+
}({});
|
|
37
|
+
export { ElbowMethod, MetricGoal, OverfitShading, RunSpread, SilhouetteView };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { WideLabel } from "./WideLabel.js";
|
|
2
|
+
import { AttentionGrid } from "./AttentionGrid.js";
|
|
3
|
+
import { AttentionModel } from "./AttentionModel.js";
|
|
4
|
+
import { AttentionSamples } from "./AttentionSamples.js";
|
|
5
|
+
import { AttentionAspect, AttentionHeadView, AttentionHeatmap } from "./AttentionHeatmap.js";
|
|
6
|
+
import { cellNumber } from "./CellNumber.js";
|
|
7
|
+
import { CurveDiagnosticSamples } from "./CurveDiagnosticSamples.js";
|
|
8
|
+
import { ElbowMethod, MetricGoal, OverfitShading, RunSpread, SilhouetteView } from "./curveDiagnosticEnums.js";
|
|
9
|
+
import { CurvePickMark } from "./CurvePickMark.js";
|
|
10
|
+
import { DistinctTicks } from "./DistinctTicks.js";
|
|
11
|
+
import { ElbowMath } from "./ElbowMath.js";
|
|
12
|
+
import { ElbowPlot } from "./ElbowPlot.js";
|
|
13
|
+
import { LearningCurveMath } from "./LearningCurveMath.js";
|
|
14
|
+
import { LearningCurveChart } from "./LearningCurveChart.js";
|
|
15
|
+
import { DecisionSamples } from "./DecisionSamples.js";
|
|
16
|
+
import { DecisionSurface } from "./DecisionSurface.js";
|
|
17
|
+
import { DecisionBoundaryChart, DecisionFill, DecisionOverlay } from "./DecisionBoundaryChart.js";
|
|
18
|
+
import { ExplainabilitySamples } from "./ExplainabilitySamples.js";
|
|
19
|
+
import { FeatureImportanceOther, FeatureImportanceSign, ImportanceRanking } from "./ImportanceRanking.js";
|
|
20
|
+
import { FeatureImportanceChart } from "./FeatureImportanceChart.js";
|
|
21
|
+
import { PartialDependence, PartialDependenceGrid } from "./PartialDependence.js";
|
|
22
|
+
import { PartialDependenceKind, PartialDependencePlot, PartialDependenceRug } from "./PartialDependencePlot.js";
|
|
23
|
+
// src/charts/mlcharts/index.ts
|
|
24
|
+
var mlchartsCatalog = [
|
|
25
|
+
AttentionHeatmap,
|
|
26
|
+
LearningCurveChart,
|
|
27
|
+
ElbowPlot,
|
|
28
|
+
DecisionBoundaryChart,
|
|
29
|
+
FeatureImportanceChart,
|
|
30
|
+
PartialDependencePlot
|
|
31
|
+
];
|
|
32
|
+
export { AttentionAspect, AttentionGrid, AttentionHeadView, AttentionHeatmap, AttentionModel, AttentionSamples, CurveDiagnosticSamples, CurvePickMark, DecisionBoundaryChart, DecisionFill, DecisionOverlay, DecisionSamples, DecisionSurface, DistinctTicks, ElbowMath, ElbowMethod, ElbowPlot, ExplainabilitySamples, FeatureImportanceChart, FeatureImportanceOther, FeatureImportanceSign, ImportanceRanking, LearningCurveChart, LearningCurveMath, MetricGoal, OverfitShading, PartialDependence, PartialDependenceGrid, PartialDependenceKind, PartialDependencePlot, PartialDependenceRug, RunSpread, SilhouetteView, WideLabel, cellNumber, mlchartsCatalog };
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
+
import { SetData } from "./SetData.js";
|
|
1
2
|
import { MarkShape, PieAnchor, PieLabel, PieSweep, ShareSort } from "./ShareEnums.js";
|
|
2
3
|
import { ShareData } from "./ShareData.js";
|
|
3
|
-
import { ShareChart } from "./ShareChart.js";
|
|
4
|
-
import { ConeApex, ConeDepth, ConeFunnel, ConeProfile } from "./ConeFunnel.js";
|
|
5
|
-
import { ExtrudedPieChart, PieHeight, PiePull } from "./ExtrudedPieChart.js";
|
|
6
4
|
import { UpSetOrder, UpSetPlot } from "./UpSetPlot.js";
|
|
7
|
-
import { SetData } from "./SetData.js";
|
|
8
5
|
import { UnitPath, UnitShape, Waffle3DChart, WaffleSolid } from "./Waffle3DChart.js";
|
|
9
|
-
import { EulerDiagram } from "./EulerDiagram.js";
|
|
10
6
|
import { EulerLayout } from "./EulerLayout.js";
|
|
11
7
|
import { SetRegions } from "./SetRegions.js";
|
|
12
8
|
import { SetDiagram, SetFill, SetLabel } from "./SetDiagram.js";
|
|
9
|
+
import { EulerDiagram } from "./EulerDiagram.js";
|
|
10
|
+
import { ShareChart } from "./ShareChart.js";
|
|
13
11
|
import { AreaArrange, AreaLabel, ProportionalAreaChart } from "./ProportionalAreaChart.js";
|
|
14
12
|
import { VennDiagram, VennPose } from "./VennDiagram.js";
|
|
15
|
-
import { VoronoiBoundary, VoronoiLabel, VoronoiShareChart } from "./VoronoiShareChart.js";
|
|
16
13
|
import { PowerDiagram, SeedPattern } from "./PowerDiagram.js";
|
|
14
|
+
import { VoronoiBoundary, VoronoiLabel, VoronoiShareChart } from "./VoronoiShareChart.js";
|
|
17
15
|
import { FunnelAlign, FunnelChart, FunnelDepth, FunnelForm, FunnelNote } from "./FunnelChart.js";
|
|
18
16
|
import { MosaicChart, MosaicLabel, MosaicMode } from "./MosaicChart.js";
|
|
19
17
|
import { ParliamentChart, ParliamentLayout, SeatOrder } from "./ParliamentChart.js";
|
|
@@ -50,8 +48,6 @@ var proportionCatalog = [
|
|
|
50
48
|
VennDiagram,
|
|
51
49
|
EulerDiagram,
|
|
52
50
|
UpSetPlot,
|
|
53
|
-
ConeFunnel,
|
|
54
|
-
ExtrudedPieChart,
|
|
55
51
|
Waffle3DChart
|
|
56
52
|
];
|
|
57
|
-
export { AreaArrange, AreaLabel, BarLabel, BarOfPie, BarThickness, BarTile, BreakoutForm, BreakoutSide,
|
|
53
|
+
export { AreaArrange, AreaLabel, BarLabel, BarOfPie, BarThickness, BarTile, BreakoutForm, BreakoutSide, DonutCentre, DonutChart, DotMatrixChart, DotMatrixLayout, DotRemainder, EulerDiagram, EulerLayout, ExplodedPie, FacetArrange, FacetForm, FacetSizing, FunnelAlign, FunnelChart, FunnelDepth, FunnelForm, FunnelNote, MarkShape, MosaicChart, MosaicLabel, MosaicMode, NestedDonut, NestedMode, ParliamentChart, ParliamentLayout, PieAnchor, PieBase, PieChart, PieExplode, PieLabel, PiePerCategory, PieSweep, PowerDiagram, ProportionalAreaChart, PyramidApex, PyramidChart, PyramidForm, PyramidLabel, PyramidSizing, RingSizing, RingSweep, SeatOrder, SeedPattern, SemiDonutChart, SemiOpening, SetData, SetDiagram, SetFill, SetLabel, SetRegions, ShareChart, ShareData, ShareSort, TreemapBar, UnitPath, UnitShape, UpSetOrder, UpSetPlot, VennDiagram, VennPose, VoronoiBoundary, VoronoiLabel, VoronoiShareChart, Waffle3DChart, WaffleArrange, WaffleChart, WaffleRoute, WaffleSolid, proportionCatalog };
|
|
@@ -22,7 +22,6 @@ var CategoryScatterBase = class extends CartesianChart {
|
|
|
22
22
|
return {
|
|
23
23
|
group: "group",
|
|
24
24
|
value: "value",
|
|
25
|
-
size: "size",
|
|
26
25
|
orientation: Orientation.Vertical,
|
|
27
26
|
scale: ScaleKind.Linear,
|
|
28
27
|
sort: "data-order",
|
|
@@ -43,17 +42,15 @@ var CategoryScatterBase = class extends CartesianChart {
|
|
|
43
42
|
return this.vertical ? [across, along] : [along, across];
|
|
44
43
|
}
|
|
45
44
|
rows() {
|
|
46
|
-
const { data, group, value,
|
|
45
|
+
const { data, group, value, scale } = this.options;
|
|
47
46
|
return (data ?? []).flatMap((row, index) => {
|
|
48
47
|
const measure = scatterNumber(row[value]);
|
|
49
48
|
if (!Number.isFinite(measure) || scale === ScaleKind.Log && measure <= 0) return [];
|
|
50
|
-
const magnitude = scatterNumber(row[size]);
|
|
51
49
|
const name = String(row[group] ?? "All");
|
|
52
50
|
return [{
|
|
53
51
|
lane: this.laneOf(name),
|
|
54
52
|
group: name,
|
|
55
53
|
value: measure,
|
|
56
|
-
size: Number.isFinite(magnitude) ? magnitude : 0,
|
|
57
54
|
row,
|
|
58
55
|
index
|
|
59
56
|
}];
|
|
@@ -14,6 +14,7 @@ var ConnectedDotMode = /* @__PURE__ */ function(ConnectedDotMode) {
|
|
|
14
14
|
ConnectedDotMode["All"] = "all-dots";
|
|
15
15
|
ConnectedDotMode["Ends"] = "end-dots";
|
|
16
16
|
ConnectedDotMode["Sparse"] = "sparse-dots";
|
|
17
|
+
ConnectedDotMode["None"] = "no-dots";
|
|
17
18
|
return ConnectedDotMode;
|
|
18
19
|
}({});
|
|
19
20
|
/** Pair the walks of two series, one x/y path per pair of series. */
|
|
@@ -76,7 +77,8 @@ var ConnectedScatter = class extends ScatterBase {
|
|
|
76
77
|
curve: CurveKind.CatmullRom,
|
|
77
78
|
arrows: "arrows-along",
|
|
78
79
|
dots: "sparse-dots",
|
|
79
|
-
endLabels: true
|
|
80
|
+
endLabels: true,
|
|
81
|
+
periodicLabels: false
|
|
80
82
|
};
|
|
81
83
|
}
|
|
82
84
|
orderValue(point) {
|
|
@@ -88,7 +90,7 @@ var ConnectedScatter = class extends ScatterBase {
|
|
|
88
90
|
return raw instanceof Date ? utcFormat("%b %-d")(raw) : String(raw ?? point.index);
|
|
89
91
|
}
|
|
90
92
|
plotPoints(ctx, _axes, points) {
|
|
91
|
-
const { curve, arrows, dots, endLabels } = this.options;
|
|
93
|
+
const { curve, arrows, dots, endLabels, periodicLabels } = this.options;
|
|
92
94
|
const paths = [...group(points, (point) => point.group)].map(([key, set]) => ({
|
|
93
95
|
key,
|
|
94
96
|
set: [...set].sort((a, b) => ascending(this.orderValue(a), this.orderValue(b)))
|
|
@@ -97,7 +99,7 @@ var ConnectedScatter = class extends ScatterBase {
|
|
|
97
99
|
const lines = ctx.marks("paths", "path", paths, (d) => d.key).attr("fill", "none").attr("stroke", (d) => ctx.palette.color(d.key)).attr("stroke-width", 2).attr("stroke-linejoin", "round").attr("stroke-linecap", "round");
|
|
98
100
|
ctx.set(lines, { d: (d) => trace(d.set) });
|
|
99
101
|
ctx.drawOn(lines);
|
|
100
|
-
const visible = paths.flatMap(({ set }) => set.filter((_, i) => dots === "all-dots" || i === 0 || i === set.length - 1 || dots === "sparse-dots" && i % 6 === 0));
|
|
102
|
+
const visible = dots === "no-dots" ? [] : paths.flatMap(({ set }) => set.filter((_, i) => dots === "all-dots" || i === 0 || i === set.length - 1 || dots === "sparse-dots" && i % 6 === 0));
|
|
101
103
|
this.drawDots(ctx, visible, { radius: this.options.radius - .5 });
|
|
102
104
|
const heads = paths.flatMap(({ key, set }) => {
|
|
103
105
|
return (arrows === "no-arrows" ? [] : arrows === "arrow-end" ? [set.length - 1] : set.flatMap((_, i) => i % 6 === 3 ? [i] : [])).flatMap((i) => {
|
|
@@ -114,7 +116,8 @@ var ConnectedScatter = class extends ScatterBase {
|
|
|
114
116
|
});
|
|
115
117
|
const arrow = ctx.marks("arrows", "path", heads, (d) => `${d.key}/${d.at}`).attr("fill", (d) => ctx.palette.color(d.key)).attr("d", "M6,0L-5,-5L-2,0L-5,5Z");
|
|
116
118
|
ctx.set(arrow, { transform: (d) => `translate(${d.tip?.px ?? d.x},${d.tip?.py ?? d.y}) rotate(${d.angle})` });
|
|
117
|
-
const
|
|
119
|
+
const every = (set) => Math.max(1, Math.ceil(set.length / 5));
|
|
120
|
+
const ends = endLabels ? paths.flatMap(({ set }) => set.length > 1 ? set.filter((_, i) => i === 0 || i === set.length - 1 || periodicLabels && i % every(set) === 0) : []) : [];
|
|
118
121
|
const taken = [];
|
|
119
122
|
const tags = ends.flatMap((point) => {
|
|
120
123
|
const right = point.px < ctx.plot.width - 60;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { ChartFamily, DataShape, Dimension } from "../../core/enums.js";
|
|
2
2
|
import { SampleData } from "../../data/SampleData.js";
|
|
3
|
-
import { ScatterBinRule } from "./GridBinScatter.js";
|
|
4
3
|
import { ScatterBase, ScatterScaling } from "./ScatterBase.js";
|
|
5
4
|
import { ascending, bin, deviation, group, line, max, quantile, range, thresholdFreedmanDiaconis, thresholdScott, thresholdSturges } from "d3";
|
|
6
5
|
// src/charts/scatter/MarginalScatter.ts
|
|
6
|
+
var ScatterBinRule = /* @__PURE__ */ function(ScatterBinRule) {
|
|
7
|
+
ScatterBinRule["Sturges"] = "sturges";
|
|
8
|
+
ScatterBinRule["Scott"] = "scott";
|
|
9
|
+
ScatterBinRule["FreedmanDiaconis"] = "freedman-diaconis";
|
|
10
|
+
return ScatterBinRule;
|
|
11
|
+
}({});
|
|
7
12
|
var MarginalKind = /* @__PURE__ */ function(MarginalKind) {
|
|
8
13
|
MarginalKind["Histogram"] = "histogram";
|
|
9
14
|
MarginalKind["Density"] = "density";
|
|
@@ -23,9 +28,9 @@ var MarginalSplit = /* @__PURE__ */ function(MarginalSplit) {
|
|
|
23
28
|
return MarginalSplit;
|
|
24
29
|
}({});
|
|
25
30
|
var RULES = {
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
31
|
+
["sturges"]: thresholdSturges,
|
|
32
|
+
["scott"]: thresholdScott,
|
|
33
|
+
["freedman-diaconis"]: thresholdFreedmanDiaconis
|
|
29
34
|
};
|
|
30
35
|
var GAP = 8;
|
|
31
36
|
/** The joint distribution beside both marginals: the classic joint plot. */
|
|
@@ -56,10 +61,10 @@ var MarginalScatter = class extends ScatterBase {
|
|
|
56
61
|
"right-margin"
|
|
57
62
|
],
|
|
58
63
|
split: ["overall", "per-group"],
|
|
59
|
-
rule: [
|
|
64
|
+
rule: ["sturges", "freedman-diaconis"],
|
|
60
65
|
scaling: [ScatterScaling.Linear, ScatterScaling.LogLog]
|
|
61
66
|
},
|
|
62
|
-
valid: (v) => v.marginal === "histogram" || v.rule ===
|
|
67
|
+
valid: (v) => v.marginal === "histogram" || v.rule === "sturges"
|
|
63
68
|
};
|
|
64
69
|
defaults() {
|
|
65
70
|
return {
|
|
@@ -67,7 +72,7 @@ var MarginalScatter = class extends ScatterBase {
|
|
|
67
72
|
marginal: "histogram",
|
|
68
73
|
sides: "both-margins",
|
|
69
74
|
split: "overall",
|
|
70
|
-
rule:
|
|
75
|
+
rule: "sturges",
|
|
71
76
|
marginSize: 52,
|
|
72
77
|
radius: 4.5
|
|
73
78
|
};
|
|
@@ -248,4 +253,4 @@ var MarginalScatter = class extends ScatterBase {
|
|
|
248
253
|
});
|
|
249
254
|
}
|
|
250
255
|
};
|
|
251
|
-
export { MarginalKind, MarginalScatter, MarginalSides, MarginalSplit };
|
|
256
|
+
export { MarginalKind, MarginalScatter, MarginalSides, MarginalSplit, ScatterBinRule };
|
|
@@ -1,41 +1,31 @@
|
|
|
1
1
|
import { SCATTER_ALL, ScatterBase, ScatterDomain, ScatterMarker, ScatterScaling, scatterKey, scatterNumber, thinLogTicks } from "./ScatterBase.js";
|
|
2
|
-
import { CategoryScatterBase, CategorySort, CategorySummary } from "./CategoryScatterBase.js";
|
|
3
|
-
import { BeeswarmLanes, BeeswarmLayout, BeeswarmScatter, BeeswarmSide } from "./BeeswarmScatter.js";
|
|
4
2
|
import { BubbleChart, BubblePlacement } from "./BubbleChart.js";
|
|
5
3
|
import { ConnectedArrows, ConnectedDotMode, ConnectedScatter } from "./ConnectedScatter.js";
|
|
6
4
|
import { ScatterGeometry } from "./ScatterGeometry.js";
|
|
7
5
|
import { ConvexHullScatter, HullScope, HullShape } from "./ConvexHullScatter.js";
|
|
8
6
|
import { EllipseEstimator, EllipseScatter, EllipseScope } from "./EllipseScatter.js";
|
|
9
7
|
import { ErrorBarScatter, ErrorDirection, ErrorSide, ErrorStyle } from "./ErrorBarScatter.js";
|
|
10
|
-
import {
|
|
11
|
-
import { GridBinScatter, ScatterBinRule, ScatterGridCell } from "./GridBinScatter.js";
|
|
12
|
-
import { HexbinScatter } from "./HexbinScatter.js";
|
|
8
|
+
import { CategoryScatterBase, CategorySort, CategorySummary } from "./CategoryScatterBase.js";
|
|
13
9
|
import { JitterMethod, JitterPlot } from "./JitterPlot.js";
|
|
14
|
-
import { MarginalKind, MarginalScatter, MarginalSides, MarginalSplit } from "./MarginalScatter.js";
|
|
10
|
+
import { MarginalKind, MarginalScatter, MarginalSides, MarginalSplit, ScatterBinRule } from "./MarginalScatter.js";
|
|
15
11
|
import { QuadrantChart, QuadrantSplit } from "./QuadrantChart.js";
|
|
16
12
|
import { Regression, RegressionMethod } from "./Regression.js";
|
|
17
13
|
import { RegressionBand, RegressionScatter, RegressionScope } from "./RegressionScatter.js";
|
|
18
14
|
import { RugAxes, RugMark, RugPlacement, RugScatter } from "./RugScatter.js";
|
|
19
15
|
import { ScatterPlot } from "./ScatterPlot.js";
|
|
20
|
-
import { StripScatter, StripScatterMark } from "./StripScatter.js";
|
|
21
16
|
import { NeighbourScope, Tessellation, VoronoiScatter } from "./VoronoiScatter.js";
|
|
22
17
|
import { ChangePath, ChangeScatter, ChangeStyle } from "./ChangeScatter.js";
|
|
23
|
-
import { ContourScatter, ScatterContourLevels, ScatterContourPoints, ScatterContourScope } from "./ContourScatter.js";
|
|
24
18
|
import { DropAxis, DropLineScatter, DropReference } from "./DropLineScatter.js";
|
|
25
19
|
import { LabelLayout, LabelLeader, LabelSelection, LabelledScatter } from "./LabelledScatter.js";
|
|
26
20
|
import { ParetoGoal, ParetoScatter, ParetoStep } from "./ParetoScatter.js";
|
|
27
|
-
import { SunflowerLattice, SunflowerScatter, SunflowerScatterPetal } from "./SunflowerScatter.js";
|
|
28
21
|
// src/charts/scatter/index.ts
|
|
29
22
|
var scatterCatalog = [
|
|
30
23
|
ScatterPlot,
|
|
31
24
|
BubbleChart,
|
|
32
25
|
RegressionScatter,
|
|
33
26
|
JitterPlot,
|
|
34
|
-
StripScatter,
|
|
35
27
|
QuadrantChart,
|
|
36
28
|
ConnectedScatter,
|
|
37
|
-
HexbinScatter,
|
|
38
|
-
GridBinScatter,
|
|
39
29
|
RugScatter,
|
|
40
30
|
MarginalScatter,
|
|
41
31
|
ErrorBarScatter,
|
|
@@ -43,11 +33,8 @@ var scatterCatalog = [
|
|
|
43
33
|
ConvexHullScatter,
|
|
44
34
|
VoronoiScatter,
|
|
45
35
|
LabelledScatter,
|
|
46
|
-
BeeswarmScatter,
|
|
47
|
-
ContourScatter,
|
|
48
36
|
ParetoScatter,
|
|
49
37
|
DropLineScatter,
|
|
50
|
-
ChangeScatter
|
|
51
|
-
SunflowerScatter
|
|
38
|
+
ChangeScatter
|
|
52
39
|
];
|
|
53
|
-
export {
|
|
40
|
+
export { BubbleChart, BubblePlacement, CategoryScatterBase, CategorySort, CategorySummary, ChangePath, ChangeScatter, ChangeStyle, ConnectedArrows, ConnectedDotMode, ConnectedScatter, ConvexHullScatter, DropAxis, DropLineScatter, DropReference, EllipseEstimator, EllipseScatter, EllipseScope, ErrorBarScatter, ErrorDirection, ErrorSide, ErrorStyle, HullScope, HullShape, JitterMethod, JitterPlot, LabelLayout, LabelLeader, LabelSelection, LabelledScatter, MarginalKind, MarginalScatter, MarginalSides, MarginalSplit, NeighbourScope, ParetoGoal, ParetoScatter, ParetoStep, QuadrantChart, QuadrantSplit, Regression, RegressionBand, RegressionMethod, RegressionScatter, RegressionScope, RugAxes, RugMark, RugPlacement, RugScatter, SCATTER_ALL, ScatterBase, ScatterBinRule, ScatterDomain, ScatterGeometry, ScatterMarker, ScatterPlot, ScatterScaling, Tessellation, VoronoiScatter, scatterCatalog, scatterKey, scatterNumber, thinLogTicks };
|
|
@@ -11,6 +11,11 @@ var SpectrogramFrequency = /* @__PURE__ */ function(SpectrogramFrequency) {
|
|
|
11
11
|
SpectrogramFrequency["Mel"] = "mel";
|
|
12
12
|
return SpectrogramFrequency;
|
|
13
13
|
}({});
|
|
14
|
+
var SpectrogramAmplitude = /* @__PURE__ */ function(SpectrogramAmplitude) {
|
|
15
|
+
SpectrogramAmplitude["Decibel"] = "decibel";
|
|
16
|
+
SpectrogramAmplitude["Linear"] = "linear";
|
|
17
|
+
return SpectrogramAmplitude;
|
|
18
|
+
}({});
|
|
14
19
|
var SpectrogramRender = /* @__PURE__ */ function(SpectrogramRender) {
|
|
15
20
|
SpectrogramRender["Cells"] = "cells";
|
|
16
21
|
SpectrogramRender["Contours"] = "contours";
|
|
@@ -59,6 +64,7 @@ var SpectrogramChart = class extends CartesianChart {
|
|
|
59
64
|
frequency: "linear-hz",
|
|
60
65
|
render: "cells",
|
|
61
66
|
track: false,
|
|
67
|
+
amplitude: "decibel",
|
|
62
68
|
grid: false
|
|
63
69
|
};
|
|
64
70
|
}
|
|
@@ -125,13 +131,13 @@ var SpectrogramChart = class extends CartesianChart {
|
|
|
125
131
|
super.draw(ctx);
|
|
126
132
|
}
|
|
127
133
|
plotMarks(ctx, { x, y }) {
|
|
128
|
-
const { render, track, floor } = this.options;
|
|
134
|
+
const { render, track, floor, amplitude } = this.options;
|
|
129
135
|
const { width, height } = ctx.plot;
|
|
130
136
|
const { times, frequencies, power } = this.frames();
|
|
131
137
|
if (!times.length) return;
|
|
132
138
|
const stride = Math.max(1, Math.ceil(frequencies.length / 96));
|
|
133
139
|
const rows = frequencies.map((_, i) => i).filter((i) => i % stride === 0);
|
|
134
|
-
const level = (db) => (db - floor) / -floor;
|
|
140
|
+
const level = (db) => amplitude === "linear" ? 10 ** (db / 20) : (db - floor) / -floor;
|
|
135
141
|
const halfFrame = times.length > 1 ? (times[1] - times[0]) / 2 : times[0];
|
|
136
142
|
const left = (f) => x(times[f] - halfFrame), right = (f) => x(times[f] + halfFrame);
|
|
137
143
|
const edge = (i) => {
|
|
@@ -227,4 +233,4 @@ var SpectrogramChart = class extends CartesianChart {
|
|
|
227
233
|
}));
|
|
228
234
|
}
|
|
229
235
|
};
|
|
230
|
-
export { SpectrogramChart, SpectrogramFrequency, SpectrogramRender };
|
|
236
|
+
export { SpectrogramAmplitude, SpectrogramChart, SpectrogramFrequency, SpectrogramRender };
|
|
@@ -10,7 +10,7 @@ import { PhaseBoundary, PhaseDiagram, PhaseDiagramSystem } from "./PhaseDiagram.
|
|
|
10
10
|
import { PiperDiagram, PiperPanels, PiperSizing } from "./PiperDiagram.js";
|
|
11
11
|
import { LogoAlphabet, LogoForm, LogoMetric, LogoOrder, SequenceLogoChart } from "./SequenceLogoChart.js";
|
|
12
12
|
import { SpectralAnalysis, SpectralWindow } from "./SpectralAnalysis.js";
|
|
13
|
-
import { SpectrogramChart, SpectrogramFrequency, SpectrogramRender } from "./SpectrogramChart.js";
|
|
13
|
+
import { SpectrogramAmplitude, SpectrogramChart, SpectrogramFrequency, SpectrogramRender } from "./SpectrogramChart.js";
|
|
14
14
|
import { RoseForm, RoseRadial, RoseStrainChart, RoseSymmetry } from "./RoseStrainChart.js";
|
|
15
15
|
import { StiffDiagram, StiffForm, StiffLayout, StiffUnit } from "./StiffDiagram.js";
|
|
16
16
|
import { SkewTChart, SoundingDiagram, SoundingParcel } from "./SkewTChart.js";
|
|
@@ -41,4 +41,4 @@ var scientificCatalog = [
|
|
|
41
41
|
PeriodicTableChart,
|
|
42
42
|
PhaseDiagram
|
|
43
43
|
];
|
|
44
|
-
export { ChromatogramBaseline, ChromatogramChart, ChromatogramLayout, ChromatogramPeaks, ClimateChart, ClimateYearStart, ClimographChart, ClimographForm, ClimographRain, ElectrophoresisGel, GelBand, GelMigration, HertzsprungRussell, HodographChart, HodographFrame, HodographMark, HodographStorm, LogoAlphabet, LogoForm, LogoMetric, LogoOrder, MassSpectrumChart, PeriodicEncoding, PeriodicLayout, PeriodicTableChart, PhaseBoundary, PhaseDiagram, PhaseDiagramSystem, PiperDiagram, PiperPanels, PiperSizing, RoseForm, RoseRadial, RoseStrainChart, RoseSymmetry, SequenceLogoChart, SkewTChart, SoilClassStyle, SoilMark, SoilSystem, SoilTextureChart, SoundingDiagram, SoundingParcel, SpectralAnalysis, SpectralWindow, SpectrogramChart, SpectrogramFrequency, SpectrogramRender, SpectrumDisplay, SpectrumIntensity, StellarAbscissa, StellarGuides, StellarMark, StellarOrdinate, StereonetChart, StereonetFeature, StereonetHemisphere, StereonetNet, StereonetProjection, StiffDiagram, StiffForm, StiffLayout, StiffUnit, TaylorDiagram, TaylorMark, TaylorSpan, TernaryApex, TernaryGrid, TernaryMark, TernaryPlot, TernaryTransform, WalterLiethChart, WalterLiethFill, scientificCatalog };
|
|
44
|
+
export { ChromatogramBaseline, ChromatogramChart, ChromatogramLayout, ChromatogramPeaks, ClimateChart, ClimateYearStart, ClimographChart, ClimographForm, ClimographRain, ElectrophoresisGel, GelBand, GelMigration, HertzsprungRussell, HodographChart, HodographFrame, HodographMark, HodographStorm, LogoAlphabet, LogoForm, LogoMetric, LogoOrder, MassSpectrumChart, PeriodicEncoding, PeriodicLayout, PeriodicTableChart, PhaseBoundary, PhaseDiagram, PhaseDiagramSystem, PiperDiagram, PiperPanels, PiperSizing, RoseForm, RoseRadial, RoseStrainChart, RoseSymmetry, SequenceLogoChart, SkewTChart, SoilClassStyle, SoilMark, SoilSystem, SoilTextureChart, SoundingDiagram, SoundingParcel, SpectralAnalysis, SpectralWindow, SpectrogramAmplitude, SpectrogramChart, SpectrogramFrequency, SpectrogramRender, SpectrumDisplay, SpectrumIntensity, StellarAbscissa, StellarGuides, StellarMark, StellarOrdinate, StereonetChart, StereonetFeature, StereonetHemisphere, StereonetNet, StereonetProjection, StiffDiagram, StiffForm, StiffLayout, StiffUnit, TaylorDiagram, TaylorMark, TaylorSpan, TernaryApex, TernaryGrid, TernaryMark, TernaryPlot, TernaryTransform, WalterLiethChart, WalterLiethFill, scientificCatalog };
|
|
@@ -5,12 +5,8 @@ import { SignalChart, SignalParser } from "./SignalChart.js";
|
|
|
5
5
|
import { AudiogramChart, AudiogramLayout, AudiogramSpacing } from "./AudiogramChart.js";
|
|
6
6
|
import { SignalSamples } from "./SignalSamples.js";
|
|
7
7
|
import { CepstrumAxis, CepstrumChart, CepstrumKind, CepstrumMark } from "./CepstrumChart.js";
|
|
8
|
-
import { SignalRaster } from "./SignalRaster.js";
|
|
9
|
-
import { ConstellationChart, ConstellationDisplay } from "./ConstellationChart.js";
|
|
10
|
-
import { CorrelogramBand, CorrelogramChart, CorrelogramFunction, CorrelogramMark } from "./CorrelogramChart.js";
|
|
11
8
|
import { ECGChart, EcgAnnotation, EcgLayout, EcgView } from "./ECGChart.js";
|
|
12
9
|
import { EnvelopeChart, EnvelopeMethod, EnvelopeShape } from "./EnvelopeChart.js";
|
|
13
|
-
import { EyeDiagramChart, EyeDisplay } from "./EyeDiagramChart.js";
|
|
14
10
|
import { FilterResponseChart, FilterView } from "./FilterResponseChart.js";
|
|
15
11
|
import { ImpulseMark, ImpulseResponseChart, ImpulseTime, ImpulseView } from "./ImpulseResponseChart.js";
|
|
16
12
|
import { LogicAnalyzerChart, LogicDisplay, LogicEdge } from "./LogicAnalyzerChart.js";
|
|
@@ -19,16 +15,15 @@ import { SpectralChart } from "./SpectralChart.js";
|
|
|
19
15
|
import { PeriodogramAbscissa, PeriodogramChart, PeriodogramMethod } from "./PeriodogramChart.js";
|
|
20
16
|
import { Phase3DCoordinates, Phase3DStyle, PhaseSpace3DChart } from "./PhaseSpace3DChart.js";
|
|
21
17
|
import { PhaseCoordinates, PhaseMark, PhaseSpaceChart } from "./PhaseSpaceChart.js";
|
|
22
|
-
import { PolePlane, PoleZeroChart } from "./PoleZeroChart.js";
|
|
23
18
|
import { SeismogramChart, SeismogramFill, SeismogramGain, SeismogramLayout } from "./SeismogramChart.js";
|
|
24
|
-
import { TimeFrequencyChart } from "./TimeFrequencyChart.js";
|
|
25
|
-
import { SignalSpectrogramChart } from "./SpectrogramChart.js";
|
|
26
19
|
import { SpectrumChart, SpectrumMark } from "./SpectrumChart.js";
|
|
27
20
|
import { StemReconstruction, StemSignalChart } from "./StemSignalChart.js";
|
|
28
21
|
import { DiffMetric, DiffView, TimeDomainDiffChart } from "./TimeDomainDiffChart.js";
|
|
29
22
|
import { WaterfallFill, WaterfallOrder, WaterfallProjection, WaterfallSpectrum } from "./WaterfallSpectrum.js";
|
|
30
23
|
import { SurfaceSpectrumStyle, WaterfallSurface3DChart } from "./WaterfallSurface3DChart.js";
|
|
31
24
|
import { WaveformChart, WaveformStyle } from "./WaveformChart.js";
|
|
25
|
+
import { SignalRaster } from "./SignalRaster.js";
|
|
26
|
+
import { TimeFrequencyChart } from "./TimeFrequencyChart.js";
|
|
32
27
|
import { WaveletAxis, WaveletScalogram, WaveletValue } from "./WaveletScalogram.js";
|
|
33
28
|
// src/charts/signals/index.ts
|
|
34
29
|
var signalsCatalog = [
|
|
@@ -39,22 +34,17 @@ var signalsCatalog = [
|
|
|
39
34
|
TimeDomainDiffChart,
|
|
40
35
|
SpectrumChart,
|
|
41
36
|
PeriodogramChart,
|
|
42
|
-
SignalSpectrogramChart,
|
|
43
37
|
WaterfallSpectrum,
|
|
44
38
|
WaterfallSurface3DChart,
|
|
45
39
|
WaveletScalogram,
|
|
46
40
|
CepstrumChart,
|
|
47
|
-
CorrelogramChart,
|
|
48
41
|
ImpulseResponseChart,
|
|
49
42
|
FilterResponseChart,
|
|
50
|
-
PoleZeroChart,
|
|
51
43
|
AudiogramChart,
|
|
52
44
|
SeismogramChart,
|
|
53
45
|
ECGChart,
|
|
54
46
|
LogicAnalyzerChart,
|
|
55
|
-
EyeDiagramChart,
|
|
56
|
-
ConstellationChart,
|
|
57
47
|
PhaseSpaceChart,
|
|
58
48
|
PhaseSpace3DChart
|
|
59
49
|
];
|
|
60
|
-
export { AudiogramChart, AudiogramLayout, AudiogramSpacing, CepstrumAxis, CepstrumChart, CepstrumKind, CepstrumMark,
|
|
50
|
+
export { AudiogramChart, AudiogramLayout, AudiogramSpacing, CepstrumAxis, CepstrumChart, CepstrumKind, CepstrumMark, DiffMetric, DiffView, ECGChart, EcgAnnotation, EcgLayout, EcgView, EnvelopeChart, EnvelopeMethod, EnvelopeShape, FilterResponseChart, FilterView, ImpulseMark, ImpulseResponseChart, ImpulseTime, ImpulseView, LogicAnalyzerChart, LogicDisplay, LogicEdge, OscilloscopeChart, PeriodogramAbscissa, PeriodogramChart, PeriodogramMethod, Phase3DCoordinates, Phase3DStyle, PhaseCoordinates, PhaseMark, PhaseSpace3DChart, PhaseSpaceChart, ScopeCoupling, ScopeDisplay, ScopeMode, ScopeTrigger, SeismogramChart, SeismogramFill, SeismogramGain, SeismogramLayout, SignalAmplitude, SignalChart, SignalDsp, SignalFrequencyScale, SignalLayout, SignalParser, SignalRaster, SignalSamples, SignalScales, SignalWavelet, SignalWindow, SpectralChart, SpectrumChart, SpectrumMark, StemReconstruction, StemSignalChart, SurfaceSpectrumStyle, TimeDomainDiffChart, TimeFrequencyChart, WaterfallFill, WaterfallOrder, WaterfallProjection, WaterfallSpectrum, WaterfallSurface3DChart, WaveformChart, WaveformStyle, WaveletAxis, WaveletScalogram, WaveletValue, signalsCatalog };
|
|
@@ -110,10 +110,13 @@ var LorenzCurve = class extends StatisticalChart {
|
|
|
110
110
|
}
|
|
111
111
|
legendItems() {
|
|
112
112
|
const arms = new Map(this.arms().map((arm) => [arm.key, arm]));
|
|
113
|
-
return this.palette.items().map((item, i) =>
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
return this.palette.items().map((item, i) => {
|
|
114
|
+
const arm = arms.get(item.key);
|
|
115
|
+
return arm ? {
|
|
116
|
+
...item,
|
|
117
|
+
label: `${item.key} ${i ? "" : "Gini "}${arm.gini.toFixed(2).replace(/^0/, "")}`
|
|
118
|
+
} : item;
|
|
119
|
+
});
|
|
117
120
|
}
|
|
118
121
|
plotMarks(ctx, axes) {
|
|
119
122
|
const { form, fill, marker, resolution } = this.options;
|
|
@@ -18,6 +18,7 @@ var CandleVolume3D = /* @__PURE__ */ function(CandleVolume3D) {
|
|
|
18
18
|
CandleVolume3D["None"] = "none";
|
|
19
19
|
CandleVolume3D["Mat"] = "volume-mat";
|
|
20
20
|
CandleVolume3D["Depth"] = "volume-depth";
|
|
21
|
+
CandleVolume3D["Wall"] = "volume-wall";
|
|
21
22
|
return CandleVolume3D;
|
|
22
23
|
}({});
|
|
23
24
|
var CandleOverlay3D = /* @__PURE__ */ function(CandleOverlay3D) {
|
|
@@ -55,7 +56,8 @@ var Candlestick3DChart = class extends Cartesian3DChart {
|
|
|
55
56
|
volumeMode: [
|
|
56
57
|
"volume-mat",
|
|
57
58
|
"none",
|
|
58
|
-
"volume-depth"
|
|
59
|
+
"volume-depth",
|
|
60
|
+
"volume-wall"
|
|
59
61
|
],
|
|
60
62
|
overlay: [
|
|
61
63
|
"none",
|
|
@@ -131,7 +133,7 @@ var Candlestick3DChart = class extends Cartesian3DChart {
|
|
|
131
133
|
const across = scaleBand(keys, [-BOX3D.x, BOX3D.x]).padding(.28);
|
|
132
134
|
const center = (i) => across(String(i)) + across.bandwidth() / 2;
|
|
133
135
|
const timeTicks = quotes.length > 1 && quotes.every((quote) => quote.date) ? scaleUtc([quotes[0].date, quotes[quotes.length - 1].date], [center(0), center(quotes.length - 1)]) : null;
|
|
134
|
-
const deep = volumeMode === "volume-mat" ? BOX3D.z : volumeMode === "volume-depth" ? .42 : .3;
|
|
136
|
+
const deep = volumeMode === "volume-mat" || volumeMode === "volume-wall" ? BOX3D.z : volumeMode === "volume-depth" ? .42 : .3;
|
|
135
137
|
const lane = volumeMode === "volume-mat" ? LANE : 0;
|
|
136
138
|
const peak = max(quotes, (quote) => quote.volume) || 1;
|
|
137
139
|
const reach = scaleLinear([0, peak], [0, BOX3D.z - lane - .04]);
|
|
@@ -221,6 +223,20 @@ var Candlestick3DChart = class extends Cartesian3DChart {
|
|
|
221
223
|
width: body,
|
|
222
224
|
depth: .024
|
|
223
225
|
}]));
|
|
226
|
+
if (volumeMode === "volume-wall") {
|
|
227
|
+
const tall = scaleLinear([0, peak], [.01, BOX3D.y * .7]);
|
|
228
|
+
blocks(parts((quote, i) => [{
|
|
229
|
+
from: [
|
|
230
|
+
center(i),
|
|
231
|
+
-BOX3D.y + .005,
|
|
232
|
+
-BOX3D.z + .03
|
|
233
|
+
],
|
|
234
|
+
axis: "y",
|
|
235
|
+
length: tall(quote.volume),
|
|
236
|
+
width: body,
|
|
237
|
+
depth: .03
|
|
238
|
+
}]));
|
|
239
|
+
}
|
|
224
240
|
if (overlay !== "none") this.overlayLines(ctx, quotes, center, price, lane, window);
|
|
225
241
|
}
|
|
226
242
|
/** Doji bodies still need a visible sliver. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Chart3D } from "../../core/Chart3D.js";
|
|
2
|
-
import {
|
|
2
|
+
import { WorldSample } from "../../data/WorldSample.js";
|
|
3
3
|
import { CylinderSurface } from "./CylinderSurface.js";
|
|
4
4
|
import { GeoMesher } from "./GeoMesher.js";
|
|
5
5
|
import { GlobeLand, GlobeProjection, GlobeSurface } from "./GlobeEnums.js";
|
|
@@ -77,7 +77,7 @@ var GlobeChart = class extends Chart3D {
|
|
|
77
77
|
this.draw(ctx);
|
|
78
78
|
}
|
|
79
79
|
get basemap() {
|
|
80
|
-
return (this.options.basemap ?? (world ??=
|
|
80
|
+
return (this.options.basemap ?? (world ??= WorldSample.countries(1))).features;
|
|
81
81
|
}
|
|
82
82
|
get oceanColor() {
|
|
83
83
|
return this.theme.grid;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SampleData } from "../../data/SampleData.js";
|
|
2
|
+
import { WorldSample } from "../../data/WorldSample.js";
|
|
2
3
|
// src/charts/threeglobe/GlobeSamples.ts
|
|
3
4
|
/** Reshapes `SampleData` into the geographic rows the globe charts read. */
|
|
4
5
|
var GlobeSamples = class {
|
|
@@ -49,7 +50,7 @@ var GlobeSamples = class {
|
|
|
49
50
|
}
|
|
50
51
|
/** World regions with a second variable, `properties.share`. */
|
|
51
52
|
static regions(seed) {
|
|
52
|
-
const world =
|
|
53
|
+
const world = WorldSample.countries(seed), other = WorldSample.countries(seed + 1);
|
|
53
54
|
return {
|
|
54
55
|
...world,
|
|
55
56
|
features: world.features.map((feature, i) => ({
|
|
@@ -75,7 +75,7 @@ var RingGlobe = class extends SiteGlobeChart {
|
|
|
75
75
|
const material = mesh.material;
|
|
76
76
|
material.transparent = true;
|
|
77
77
|
ctx.onFrame((seconds) => {
|
|
78
|
-
material.opacity = .62 + .38 * Math.cos(seconds * 2.4);
|
|
78
|
+
material.opacity = ctx.opacity * (.62 + .38 * Math.cos(seconds * 2.4));
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
this.leaders(ctx, sites, 4, () => .05);
|
|
@@ -23,6 +23,7 @@ var GanttOrder3D = /* @__PURE__ */ function(GanttOrder3D) {
|
|
|
23
23
|
var GanttHeight3D = /* @__PURE__ */ function(GanttHeight3D) {
|
|
24
24
|
GanttHeight3D["Uniform"] = "uniform";
|
|
25
25
|
GanttHeight3D["Effort"] = "effort";
|
|
26
|
+
GanttHeight3D["Progress"] = "progress";
|
|
26
27
|
return GanttHeight3D;
|
|
27
28
|
}({});
|
|
28
29
|
var BASE = -.42;
|
|
@@ -116,8 +117,8 @@ var Gantt3DChart = class extends Temporal3DBase {
|
|
|
116
117
|
const longest = Math.max(...plans.map((plan) => plan.end - plan.start));
|
|
117
118
|
const tiers = Math.max(...plans.map((plan) => plan.level)) + 1;
|
|
118
119
|
const headroom = stack === "decks" ? deckGap * .82 : Math.min(.5, 1.25 / tiers - .03);
|
|
119
|
-
const tall = (plan) => heightBy === "effort" ? .02 + (headroom - .02) * ((plan.end - plan.start) / longest) : .09;
|
|
120
|
-
const pitch = heightBy === "
|
|
120
|
+
const tall = (plan) => heightBy === "effort" ? .02 + (headroom - .02) * ((plan.end - plan.start) / longest) : heightBy === "progress" ? .02 + (headroom - .02) * plan.progress : .09;
|
|
121
|
+
const pitch = heightBy === "uniform" ? LEVEL : headroom + .03;
|
|
121
122
|
const floor = (plan) => BASE + (stack === "decks" ? groups.indexOf(plan.group) * deckGap : plan.level * pitch);
|
|
122
123
|
const zOf = (plan, i) => z(stack === "lanes" ? plan.group : plan.task + i) + z.bandwidth() / 2;
|
|
123
124
|
const seats = plans.map((plan, i) => ({
|