vizmatic 0.1.37 → 0.1.39

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/dist/index.js CHANGED
@@ -5764,6 +5764,225 @@ function ScatterPlot({
5764
5764
  )
5765
5765
  });
5766
5766
  }
5767
+ function pointDominates(candidate, point, xObjective, yObjective) {
5768
+ const xNoWorse = xObjective === "minimize" ? candidate.x <= point.x : candidate.x >= point.x;
5769
+ const yNoWorse = yObjective === "minimize" ? candidate.y <= point.y : candidate.y >= point.y;
5770
+ const xBetter = xObjective === "minimize" ? candidate.x < point.x : candidate.x > point.x;
5771
+ const yBetter = yObjective === "minimize" ? candidate.y < point.y : candidate.y > point.y;
5772
+ return xNoWorse && yNoWorse && (xBetter || yBetter);
5773
+ }
5774
+ function paretoFrontierIndices(points, xObjective, yObjective) {
5775
+ const frontier = /* @__PURE__ */ new Set();
5776
+ for (const candidate of points) {
5777
+ const dominated = points.some(({ point }) => pointDominates(point, candidate.point, xObjective, yObjective));
5778
+ if (!dominated) frontier.add(candidate.index);
5779
+ }
5780
+ return frontier;
5781
+ }
5782
+ function positiveLogDomain(values, min, max) {
5783
+ const positiveValues = values.filter((value) => Number.isFinite(value) && value > 0);
5784
+ const positiveMin = min !== void 0 && Number.isFinite(min) && min > 0 ? min : Math.min(...positiveValues, 1);
5785
+ const fallbackMax = Math.max(...positiveValues, positiveMin * 10);
5786
+ const positiveMax = max !== void 0 && Number.isFinite(max) && max > 0 ? max : fallbackMax;
5787
+ const safeMin = Math.max(Number.MIN_VALUE, positiveMin);
5788
+ const safeMax = positiveMax > safeMin ? positiveMax : safeMin * 10;
5789
+ return { min: safeMin, max: safeMax, range: Math.log(safeMax) - Math.log(safeMin) };
5790
+ }
5791
+ function logChartTicks(min, max, count = 5) {
5792
+ if (!(min > 0) || !(max > min) || count <= 1) return [min];
5793
+ const startPower = Math.ceil(Math.log10(min));
5794
+ const endPower = Math.floor(Math.log10(max));
5795
+ const powers = Array.from({ length: Math.max(0, endPower - startPower + 1) }, (_, index) => 10 ** (startPower + index)).filter((value) => value >= min && value <= max);
5796
+ if (powers.length >= 4) return powers;
5797
+ return Array.from({ length: count }, (_, index) => min * (max / min) ** (index / (count - 1)));
5798
+ }
5799
+ function ParetoChart({
5800
+ points,
5801
+ c,
5802
+ title,
5803
+ subtitle,
5804
+ width = 640,
5805
+ height = 360,
5806
+ xMin,
5807
+ xMax,
5808
+ yMin,
5809
+ yMax,
5810
+ xAxisLabel,
5811
+ yAxisLabel,
5812
+ formatX = "decimal",
5813
+ formatY = "decimal",
5814
+ showGrid = true,
5815
+ xScale = "linear",
5816
+ xObjective = "minimize",
5817
+ yObjective = "maximize",
5818
+ frontierColor,
5819
+ showGoal = true,
5820
+ goalLabel,
5821
+ footer
5822
+ }) {
5823
+ const margin = { top: 22, right: 26, bottom: xAxisLabel ? 48 : 36, left: yAxisLabel ? 56 : 44 };
5824
+ const plot = createPlotArea(width, height, margin);
5825
+ const validPoints = points.map((point, index) => ({ point, index })).filter(({ point }) => Number.isFinite(point.x) && Number.isFinite(point.y) && (xScale !== "log" || point.x > 0));
5826
+ const frontierIndices = paretoFrontierIndices(validPoints, xObjective, yObjective);
5827
+ const xDomain = xScale === "log" ? positiveLogDomain(validPoints.map(({ point }) => point.x), xMin, xMax) : chartDomain(validPoints.map(({ point }) => point.x), xMin, xMax);
5828
+ const yDomain = chartDomain(validPoints.map(({ point }) => point.y), yMin, yMax);
5829
+ const xTicks = xScale === "log" ? logChartTicks(xDomain.min, xDomain.max) : chartTicks(xDomain.min, xDomain.max, 5);
5830
+ const yTicks = chartTicks(yDomain.min, yDomain.max, 5);
5831
+ const frontier = chartColor(frontierColor ?? "positive", c, 0);
5832
+ const pointFor = (xValue, yValue) => {
5833
+ const x = xScale === "log" ? plot.x + (Math.log(xValue > 0 ? xValue : xDomain.min) - Math.log(xDomain.min)) / xDomain.range * plot.innerWidth : xInPlot(xValue, xDomain, plot);
5834
+ return {
5835
+ x: clamp(x, plot.x, plot.right),
5836
+ y: clamp(yInPlot(yValue, yDomain, plot), plot.y, plot.bottom)
5837
+ };
5838
+ };
5839
+ const pointGeometries = validPoints.map(({ point, index }) => {
5840
+ const pointPosition = pointFor(point.x, point.y);
5841
+ const isFrontier = frontierIndices.has(index);
5842
+ return {
5843
+ point,
5844
+ index,
5845
+ x: pointPosition.x,
5846
+ y: pointPosition.y,
5847
+ color: chartColor(point.color ?? (isFrontier ? frontier : "neutral"), c, index),
5848
+ frontier: isFrontier
5849
+ };
5850
+ });
5851
+ const frontierGeometries = pointGeometries.filter((geometry) => geometry.frontier).sort((left, right) => left.point.x - right.point.x);
5852
+ const frontierPath = frontierGeometries.length > 1 ? frontierGeometries.map((geometry, index) => `${index === 0 ? "M" : "L"} ${geometry.x.toFixed(1)} ${geometry.y.toFixed(1)}`).join(" ") : void 0;
5853
+ const goalText = goalLabel ?? `goal: ${xObjective === "minimize" ? "lower x" : "higher x"} \xB7 ${yObjective === "maximize" ? "higher y" : "lower y"}`;
5854
+ const goalXStart = plot.right - 72;
5855
+ const goalY = plot.y + 18;
5856
+ const goalXEnd = xObjective === "minimize" ? goalXStart - 26 : goalXStart + 26;
5857
+ const goalYStart = plot.y + 52;
5858
+ const goalYEnd = yObjective === "maximize" ? goalYStart - 26 : goalYStart + 26;
5859
+ const arrowSize = 5;
5860
+ return ChartFrame({
5861
+ c,
5862
+ title,
5863
+ subtitle,
5864
+ width,
5865
+ footer,
5866
+ legend: [
5867
+ { label: "Pareto frontier", color: frontier },
5868
+ { label: "dominated", color: "neutral" }
5869
+ ],
5870
+ children: React9.createElement(
5871
+ "div",
5872
+ { style: { position: "relative", width, height, display: "flex" } },
5873
+ React9.createElement(
5874
+ "svg",
5875
+ { width, height, viewBox: `0 0 ${width} ${height}` },
5876
+ showGrid && React9.createElement(
5877
+ "g",
5878
+ {},
5879
+ ...xTicks.map((tick) => {
5880
+ const x = pointFor(tick, yDomain.min).x;
5881
+ return React9.createElement("line", {
5882
+ key: `pareto-x-grid-${tick}`,
5883
+ x1: x,
5884
+ y1: plot.y,
5885
+ x2: x,
5886
+ y2: plot.bottom,
5887
+ stroke: c.borderSubtle,
5888
+ strokeWidth: 1
5889
+ });
5890
+ }),
5891
+ ...yTicks.map((tick) => {
5892
+ const y = yInPlot(tick, yDomain, plot);
5893
+ return React9.createElement("line", {
5894
+ key: `pareto-y-grid-${tick}`,
5895
+ x1: plot.x,
5896
+ y1: y,
5897
+ x2: plot.right,
5898
+ y2: y,
5899
+ stroke: c.borderSubtle,
5900
+ strokeWidth: 1
5901
+ });
5902
+ })
5903
+ ),
5904
+ React9.createElement("rect", {
5905
+ x: plot.x,
5906
+ y: plot.y,
5907
+ width: plot.innerWidth,
5908
+ height: plot.innerHeight,
5909
+ fill: "transparent",
5910
+ stroke: c.borderLight,
5911
+ strokeWidth: 1.2,
5912
+ rx: 6
5913
+ }),
5914
+ showGoal && React9.createElement(
5915
+ "g",
5916
+ { "data-pareto-goal": true, stroke: frontier, fill: "none", strokeWidth: 2, strokeLinecap: "round" },
5917
+ React9.createElement("line", { x1: goalXStart, y1: goalY, x2: goalXEnd, y2: goalY }),
5918
+ React9.createElement("line", { x1: goalXEnd, y1: goalY, x2: goalXEnd + (xObjective === "minimize" ? arrowSize : -arrowSize), y2: goalY - arrowSize }),
5919
+ React9.createElement("line", { x1: goalXEnd, y1: goalY, x2: goalXEnd + (xObjective === "minimize" ? arrowSize : -arrowSize), y2: goalY + arrowSize }),
5920
+ React9.createElement("line", { x1: goalXStart, y1: goalYStart, x2: goalXStart, y2: goalYEnd }),
5921
+ React9.createElement("line", { x1: goalXStart, y1: goalYEnd, x2: goalXStart - arrowSize, y2: goalYEnd + (yObjective === "maximize" ? arrowSize : -arrowSize) }),
5922
+ React9.createElement("line", { x1: goalXStart, y1: goalYEnd, x2: goalXStart + arrowSize, y2: goalYEnd + (yObjective === "maximize" ? arrowSize : -arrowSize) })
5923
+ ),
5924
+ frontierPath && React9.createElement("path", {
5925
+ "data-pareto-frontier": true,
5926
+ d: frontierPath,
5927
+ fill: "none",
5928
+ stroke: frontier,
5929
+ strokeWidth: 3,
5930
+ strokeLinecap: "round",
5931
+ strokeLinejoin: "round"
5932
+ }),
5933
+ ...pointGeometries.filter((geometry) => !geometry.frontier).concat(pointGeometries.filter((geometry) => geometry.frontier)).map(({ point, index, x, y, color, frontier: isFrontier }) => React9.createElement("circle", {
5934
+ key: `pareto-point-${point.label ?? "point"}-${index}`,
5935
+ "data-pareto-status": isFrontier ? "frontier" : "dominated",
5936
+ cx: x,
5937
+ cy: y,
5938
+ r: Math.max(4, Math.min(20, point.size ?? (isFrontier ? 8 : 7))),
5939
+ fill: color,
5940
+ opacity: isFrontier ? 1 : 0.38,
5941
+ stroke: isFrontier ? frontier : c.bgCard,
5942
+ strokeWidth: isFrontier ? 3 : 2
5943
+ }))
5944
+ ),
5945
+ ...xTicks.map((tick) => {
5946
+ const x = pointFor(tick, yDomain.min).x;
5947
+ return chartLabel(`pareto-x-tick-${tick}`, formatChartValue(tick, formatX), x, plot.bottom + 18, c, { width: 52 });
5948
+ }),
5949
+ ...yTicks.map((tick) => {
5950
+ const y = yInPlot(tick, yDomain, plot);
5951
+ return chartLabel(`pareto-y-tick-${tick}`, formatChartValue(tick, formatY), plot.x - 8, y, c, { align: "right", width: 42 });
5952
+ }),
5953
+ showGoal && chartLabel("pareto-goal-label", goalText, plot.right - 2, plot.y + 9, c, {
5954
+ align: "right",
5955
+ width: 170,
5956
+ color: frontier,
5957
+ fontWeight: 850,
5958
+ fontSize: 11,
5959
+ bounds: { x: plot.x, y: plot.y, width: plot.innerWidth, height: plot.innerHeight, padding: 4 }
5960
+ }),
5961
+ xAxisLabel && chartLabel("pareto-x-axis-label", xAxisLabel, plot.x + plot.innerWidth / 2, height - 8, c, {
5962
+ width: plot.innerWidth,
5963
+ fontFamily: "Inter",
5964
+ fontWeight: 700
5965
+ }),
5966
+ yAxisLabel && chartLabel("pareto-y-axis-label", yAxisLabel, 12, plot.y + plot.innerHeight / 2, c, {
5967
+ width: plot.innerHeight,
5968
+ fontFamily: "Inter",
5969
+ fontWeight: 700,
5970
+ transform: "translate(-50%, -50%) rotate(-90deg)"
5971
+ }),
5972
+ ...pointGeometries.flatMap(({ point, index, x, y, color, frontier: isFrontier }) => {
5973
+ if (!point.label) return [];
5974
+ const placement = pointLabelPlacement(x, y, plot, index, 110);
5975
+ return [chartLabel(`pareto-point-label-${index}`, point.label, placement.x, placement.y, c, {
5976
+ align: placement.align,
5977
+ width: placement.width,
5978
+ bounds: placement.bounds,
5979
+ color: isFrontier ? color : c.textMuted,
5980
+ fontWeight: isFrontier ? 850 : 600
5981
+ })];
5982
+ })
5983
+ )
5984
+ });
5985
+ }
5767
5986
  function QuadrantChart({
5768
5987
  points,
5769
5988
  regions,
@@ -5772,27 +5991,46 @@ function QuadrantChart({
5772
5991
  subtitle,
5773
5992
  width = 700,
5774
5993
  height = 360,
5994
+ xMin,
5995
+ xMax,
5996
+ yMin,
5997
+ yMax,
5998
+ xThreshold,
5999
+ yThreshold,
5775
6000
  xAxisLabel,
5776
6001
  yAxisLabel,
6002
+ formatX = "decimal",
6003
+ formatY = "decimal",
6004
+ showTicks = false,
6005
+ showGrid = false,
5777
6006
  footer
5778
6007
  }) {
5779
- const margin = { top: 18, right: 20, bottom: xAxisLabel ? 46 : 24, left: yAxisLabel ? 54 : 24 };
6008
+ const margin = {
6009
+ top: 18,
6010
+ right: 20,
6011
+ bottom: xAxisLabel ? showTicks ? 58 : 46 : showTicks ? 36 : 24,
6012
+ left: yAxisLabel ? showTicks ? 72 : 54 : showTicks ? 48 : 24
6013
+ };
5780
6014
  const plot = createPlotArea(width, height, margin);
5781
- const halfWidth = plot.innerWidth / 2;
5782
- const halfHeight = plot.innerHeight / 2;
5783
- const midX = plot.x + halfWidth;
5784
- const midY = plot.y + halfHeight;
6015
+ const xDomain = xMin === void 0 && xMax === void 0 ? { min: 0, max: 1, range: 1 } : chartDomain(points.map((point) => point.x), xMin, xMax);
6016
+ const yDomain = yMin === void 0 && yMax === void 0 ? { min: 0, max: 1, range: 1 } : chartDomain(points.map((point) => point.y), yMin, yMax);
6017
+ const resolvedXThreshold = clamp(xThreshold ?? xDomain.min + xDomain.range / 2, xDomain.min, xDomain.max);
6018
+ const resolvedYThreshold = clamp(yThreshold ?? yDomain.min + yDomain.range / 2, yDomain.min, yDomain.max);
6019
+ const midX = xInPlot(resolvedXThreshold, xDomain, plot);
6020
+ const midY = yInPlot(resolvedYThreshold, yDomain, plot);
6021
+ const xTicks = showTicks || showGrid ? chartTicks(xDomain.min, xDomain.max, 5) : [];
6022
+ const yTicks = showTicks || showGrid ? chartTicks(yDomain.min, yDomain.max, 5) : [];
5785
6023
  const regionEntries = [
5786
- { key: "top-left", region: regions.topLeft, x: plot.x, y: plot.y },
5787
- { key: "top-right", region: regions.topRight, x: midX, y: plot.y },
5788
- { key: "bottom-left", region: regions.bottomLeft, x: plot.x, y: midY },
5789
- { key: "bottom-right", region: regions.bottomRight, x: midX, y: midY }
6024
+ { key: "top-left", region: regions.topLeft, x: plot.x, y: plot.y, width: midX - plot.x, height: midY - plot.y },
6025
+ { key: "top-right", region: regions.topRight, x: midX, y: plot.y, width: plot.right - midX, height: midY - plot.y },
6026
+ { key: "bottom-left", region: regions.bottomLeft, x: plot.x, y: midY, width: midX - plot.x, height: plot.bottom - midY },
6027
+ { key: "bottom-right", region: regions.bottomRight, x: midX, y: midY, width: plot.right - midX, height: plot.bottom - midY }
5790
6028
  ];
5791
6029
  const pointGeometries = points.map((point, index) => ({
5792
6030
  point,
5793
6031
  index,
5794
- x: plot.x + clamp(point.x, 0, 1) * plot.innerWidth,
5795
- y: plot.y + plot.innerHeight - clamp(point.y, 0, 1) * plot.innerHeight,
6032
+ x: xInPlot(clamp(point.x, xDomain.min, xDomain.max), xDomain, plot),
6033
+ y: yInPlot(clamp(point.y, yDomain.min, yDomain.max), yDomain, plot),
5796
6034
  color: chartColor(point.color, c, index)
5797
6035
  }));
5798
6036
  return ChartFrame({
@@ -5809,15 +6047,49 @@ function QuadrantChart({
5809
6047
  React9.createElement(
5810
6048
  "svg",
5811
6049
  { width, height, viewBox: `0 0 ${width} ${height}` },
5812
- ...regionEntries.map(({ key, region, x, y }, index) => React9.createElement("rect", {
5813
- key: `quadrant-${key}`,
5814
- x,
5815
- y,
5816
- width: halfWidth,
5817
- height: halfHeight,
5818
- fill: chartColor(region.color, c, index),
5819
- opacity: 0.1
5820
- })),
6050
+ ...regionEntries.map(({ key, region, x, y, width: regionWidth, height: regionHeight }, index) => {
6051
+ const color = chartColor(region.color, c, index);
6052
+ const emphasized = region.emphasis === true;
6053
+ return React9.createElement("rect", {
6054
+ key: `quadrant-${key}`,
6055
+ x,
6056
+ y,
6057
+ width: regionWidth,
6058
+ height: regionHeight,
6059
+ fill: color,
6060
+ opacity: emphasized ? 0.2 : 0.1,
6061
+ stroke: emphasized ? color : "transparent",
6062
+ strokeWidth: emphasized ? 2 : 0
6063
+ });
6064
+ }),
6065
+ showGrid && React9.createElement(
6066
+ "g",
6067
+ {},
6068
+ ...xTicks.map((tick) => {
6069
+ const x = xInPlot(tick, xDomain, plot);
6070
+ return React9.createElement("line", {
6071
+ key: `quadrant-x-grid-${tick}`,
6072
+ x1: x,
6073
+ y1: plot.y,
6074
+ x2: x,
6075
+ y2: plot.bottom,
6076
+ stroke: c.borderSubtle,
6077
+ strokeWidth: 1
6078
+ });
6079
+ }),
6080
+ ...yTicks.map((tick) => {
6081
+ const y = yInPlot(tick, yDomain, plot);
6082
+ return React9.createElement("line", {
6083
+ key: `quadrant-y-grid-${tick}`,
6084
+ x1: plot.x,
6085
+ y1: y,
6086
+ x2: plot.right,
6087
+ y2: y,
6088
+ stroke: c.borderSubtle,
6089
+ strokeWidth: 1
6090
+ });
6091
+ })
6092
+ ),
5821
6093
  React9.createElement("rect", {
5822
6094
  x: plot.x,
5823
6095
  y: plot.y,
@@ -5844,6 +6116,30 @@ function QuadrantChart({
5844
6116
  stroke: c.borderLight,
5845
6117
  strokeWidth: 1.4
5846
6118
  }),
6119
+ ...(showTicks ? xTicks : []).map((tick) => {
6120
+ const x = xInPlot(tick, xDomain, plot);
6121
+ return React9.createElement("line", {
6122
+ key: `quadrant-x-tick-${tick}`,
6123
+ x1: x,
6124
+ y1: plot.bottom,
6125
+ x2: x,
6126
+ y2: plot.bottom + 5,
6127
+ stroke: c.textMuted,
6128
+ strokeWidth: 1.2
6129
+ });
6130
+ }),
6131
+ ...(showTicks ? yTicks : []).map((tick) => {
6132
+ const y = yInPlot(tick, yDomain, plot);
6133
+ return React9.createElement("line", {
6134
+ key: `quadrant-y-tick-${tick}`,
6135
+ x1: plot.x - 5,
6136
+ y1: y,
6137
+ x2: plot.x,
6138
+ y2: y,
6139
+ stroke: c.textMuted,
6140
+ strokeWidth: 1.2
6141
+ });
6142
+ }),
5847
6143
  ...pointGeometries.map(({ point, index, x, y, color }) => React9.createElement("circle", {
5848
6144
  key: `quadrant-point-${point.label ?? index}`,
5849
6145
  cx: x,
@@ -5854,23 +6150,31 @@ function QuadrantChart({
5854
6150
  strokeWidth: 3
5855
6151
  }))
5856
6152
  ),
5857
- ...regionEntries.flatMap(({ key, region, x, y }, index) => {
6153
+ ...regionEntries.flatMap(({ key, region, x, y, width: regionWidth }, index) => {
5858
6154
  const color = chartColor(region.color, c, index);
5859
6155
  return [
5860
- chartLabel(`quadrant-label-${key}`, region.label, x + halfWidth / 2, y + 18, c, {
5861
- width: halfWidth - 24,
6156
+ chartLabel(`quadrant-label-${key}`, region.label, x + regionWidth / 2, y + 18, c, {
6157
+ width: Math.max(1, regionWidth - 24),
5862
6158
  color,
5863
6159
  fontFamily: "Inter",
5864
6160
  fontWeight: 900,
5865
6161
  fontSize: 11
5866
6162
  }),
5867
- ...region.detail ? [chartLabel(`quadrant-detail-${key}`, region.detail, x + halfWidth / 2, y + 34, c, {
5868
- width: halfWidth - 24,
6163
+ ...region.detail ? [chartLabel(`quadrant-detail-${key}`, region.detail, x + regionWidth / 2, y + 34, c, {
6164
+ width: Math.max(1, regionWidth - 24),
5869
6165
  color: c.textMuted,
5870
6166
  fontSize: 11
5871
6167
  })] : []
5872
6168
  ];
5873
6169
  }),
6170
+ ...(showTicks ? xTicks : []).map((tick) => {
6171
+ const x = xInPlot(tick, xDomain, plot);
6172
+ return chartLabel(`quadrant-x-tick-label-${tick}`, formatChartValue(tick, formatX), x, plot.bottom + 18, c, { width: 54 });
6173
+ }),
6174
+ ...(showTicks ? yTicks : []).map((tick) => {
6175
+ const y = yInPlot(tick, yDomain, plot);
6176
+ return chartLabel(`quadrant-y-tick-label-${tick}`, formatChartValue(tick, formatY), plot.x - 9, y, c, { align: "right", width: 48 });
6177
+ }),
5874
6178
  ...pointGeometries.flatMap(({ point, index, x, y, color }) => {
5875
6179
  if (!point.label) return [];
5876
6180
  const placement = pointLabelPlacement(x, y, plot, index, 110);
@@ -7472,6 +7776,7 @@ export {
7472
7776
  MetricCard,
7473
7777
  MiniBarChart,
7474
7778
  Panel,
7779
+ ParetoChart,
7475
7780
  Pipeline,
7476
7781
  ProgressList,
7477
7782
  ProgressRow,
@@ -17,6 +17,7 @@ Rendered assets live on the [Vizmatic gallery](https://bvolpato.github.io/vizmat
17
17
  | [Catalog Drawing](catalog-drawing.tsx) | <img src="https://bvolpato.github.io/vizmatic/assets/examples/catalog-drawing_dark.png" alt="Catalog Drawing dark render" width="360" /> | <img src="https://bvolpato.github.io/vizmatic/assets/examples/catalog-drawing_light.png" alt="Catalog Drawing light render" width="360" /> |
18
18
  | [Catalog Flows](catalog-flows.tsx) | <img src="https://bvolpato.github.io/vizmatic/assets/examples/catalog-flows_dark.png" alt="Catalog Flows dark render" width="360" /> | <img src="https://bvolpato.github.io/vizmatic/assets/examples/catalog-flows_light.png" alt="Catalog Flows light render" width="360" /> |
19
19
  | [Catalog Foundations](catalog-foundations.tsx) | <img src="https://bvolpato.github.io/vizmatic/assets/examples/catalog-foundations_dark.png" alt="Catalog Foundations dark render" width="360" /> | <img src="https://bvolpato.github.io/vizmatic/assets/examples/catalog-foundations_light.png" alt="Catalog Foundations light render" width="360" /> |
20
+ | [Desired Quadrant](desired-quadrant.tsx) | <img src="https://bvolpato.github.io/vizmatic/assets/examples/desired-quadrant_dark.png" alt="Desired Quadrant dark render" width="360" /> | <img src="https://bvolpato.github.io/vizmatic/assets/examples/desired-quadrant_light.png" alt="Desired Quadrant light render" width="360" /> |
20
21
  | [Embedding Map](embedding-map.tsx) | <img src="https://bvolpato.github.io/vizmatic/assets/examples/embedding-map_dark.png" alt="Embedding Map dark render" width="360" /> | <img src="https://bvolpato.github.io/vizmatic/assets/examples/embedding-map_light.png" alt="Embedding Map light render" width="360" /> |
21
22
  | [Engineering Flow](engineering-flow.tsx) | <img src="https://bvolpato.github.io/vizmatic/assets/examples/engineering-flow_dark.png" alt="Engineering Flow dark render" width="360" /> | <img src="https://bvolpato.github.io/vizmatic/assets/examples/engineering-flow_light.png" alt="Engineering Flow light render" width="360" /> |
22
23
  | [Eval Dashboard](eval-dashboard.tsx) | <img src="https://bvolpato.github.io/vizmatic/assets/examples/eval-dashboard_dark.png" alt="Eval Dashboard dark render" width="360" /> | <img src="https://bvolpato.github.io/vizmatic/assets/examples/eval-dashboard_light.png" alt="Eval Dashboard light render" width="360" /> |
@@ -26,6 +27,7 @@ Rendered assets live on the [Vizmatic gallery](https://bvolpato.github.io/vizmat
26
27
  | [NCCL All To All](nccl-all-to-all.tsx) | <img src="https://bvolpato.github.io/vizmatic/assets/examples/nccl-all-to-all_dark.gif" alt="NCCL All To All dark render" width="360" /> | <img src="https://bvolpato.github.io/vizmatic/assets/examples/nccl-all-to-all_light.gif" alt="NCCL All To All light render" width="360" /> |
27
28
  | [NCCL Broadcast](nccl-broadcast.tsx) | <img src="https://bvolpato.github.io/vizmatic/assets/examples/nccl-broadcast_dark.gif" alt="NCCL Broadcast dark render" width="360" /> | <img src="https://bvolpato.github.io/vizmatic/assets/examples/nccl-broadcast_light.gif" alt="NCCL Broadcast light render" width="360" /> |
28
29
  | [NCCL Reduce Scatter](nccl-reduce-scatter.tsx) | <img src="https://bvolpato.github.io/vizmatic/assets/examples/nccl-reduce-scatter_dark.gif" alt="NCCL Reduce Scatter dark render" width="360" /> | <img src="https://bvolpato.github.io/vizmatic/assets/examples/nccl-reduce-scatter_light.gif" alt="NCCL Reduce Scatter light render" width="360" /> |
30
+ | [Pareto Frontier](pareto-frontier.tsx) | <img src="https://bvolpato.github.io/vizmatic/assets/examples/pareto-frontier_dark.png" alt="Pareto Frontier dark render" width="360" /> | <img src="https://bvolpato.github.io/vizmatic/assets/examples/pareto-frontier_light.png" alt="Pareto Frontier light render" width="360" /> |
29
31
  | [Presentation Frame](presentation-frame.tsx) | <img src="https://bvolpato.github.io/vizmatic/assets/examples/presentation-frame_dark.png" alt="Presentation Frame dark render" width="360" /> | <img src="https://bvolpato.github.io/vizmatic/assets/examples/presentation-frame_light.png" alt="Presentation Frame light render" width="360" /> |
30
32
  | [RAG Graph](rag-graph.tsx) | <img src="https://bvolpato.github.io/vizmatic/assets/examples/rag-graph_dark.png" alt="RAG Graph dark render" width="360" /> | <img src="https://bvolpato.github.io/vizmatic/assets/examples/rag-graph_light.png" alt="RAG Graph light render" width="360" /> |
31
33
  | [Release Card](release-card.tsx) | <img src="https://bvolpato.github.io/vizmatic/assets/examples/release-card_dark.png" alt="Release Card dark render" width="360" /> | <img src="https://bvolpato.github.io/vizmatic/assets/examples/release-card_light.png" alt="Release Card light render" width="360" /> |
@@ -8,6 +8,7 @@ import {
8
8
  IntervalPlot,
9
9
  Legend,
10
10
  LineChart,
11
+ ParetoChart,
11
12
  QuadrantChart,
12
13
  Row,
13
14
  ScatterPlot,
@@ -18,7 +19,7 @@ import {
18
19
  } from 'vizmatic'
19
20
 
20
21
  export const width = 1120
21
- export const height = 1040
22
+ export const height = 1280
22
23
 
23
24
  export function create(theme: ThemeMode = 'dark') {
24
25
  const c = getThemeColors(theme)
@@ -99,6 +100,27 @@ export function create(theme: ThemeMode = 'dark') {
99
100
  </Column>
100
101
  </Row>
101
102
 
103
+ <ParetoChart
104
+ c={c}
105
+ title="ParetoChart"
106
+ subtitle="automatic non-dominated frontier for competing objectives"
107
+ width={1080}
108
+ height={210}
109
+ xMin={0}
110
+ xMax={10}
111
+ yMin={0}
112
+ yMax={10}
113
+ xAxisLabel="cost"
114
+ points={[
115
+ { x: 1.2, y: 4.0, label: 'fast', color: 'info' },
116
+ { x: 3.8, y: 6.8, label: 'balanced', color: 'positive' },
117
+ { x: 7.0, y: 9.1, label: 'deep', color: 'primary' },
118
+ { x: 8.4, y: 7.3, label: 'dominated', color: 'warning' },
119
+ ]}
120
+ frontierColor="positive"
121
+ goalLabel="higher quality · lower cost"
122
+ />
123
+
102
124
  <Row width="100%" gap={16} align="stretch">
103
125
  <BarChart
104
126
  c={c}
@@ -162,7 +184,7 @@ export function create(theme: ThemeMode = 'dark') {
162
184
  xAxisLabel="implementation effort"
163
185
  yAxisLabel="user value"
164
186
  regions={{
165
- topLeft: { label: 'quick wins', detail: 'prioritize', color: 'positive' },
187
+ topLeft: { label: 'quick wins', detail: 'prioritize', color: 'positive', emphasis: true },
166
188
  topRight: { label: 'big bets', detail: 'stage work', color: 'primary' },
167
189
  bottomLeft: { label: 'defer', detail: 'low return', color: 'neutral' },
168
190
  bottomRight: { label: 'avoid', detail: 'high cost', color: 'warning' },
@@ -0,0 +1,80 @@
1
+ import {
2
+ QuadrantChart,
3
+ Scene,
4
+ getThemeColors,
5
+ type ThemeMode,
6
+ } from 'vizmatic'
7
+
8
+ export const width = 1040
9
+ export const height = 570
10
+
11
+ // Same Brumark v10 max-effort snapshot as pareto-frontier.tsx.
12
+ // Points stay in raw cost-per-task and weighted-score units.
13
+ const points = [
14
+ { x: 0.008280, y: 56.9015, label: 'Luna · max', color: 'info', size: 7 },
15
+ { x: 0.216884, y: 88.3919, label: 'Sol · max', color: 'primary', size: 8 },
16
+ { x: 0.086881, y: 71.3691, label: 'Terra · max', color: 'positive', size: 7 },
17
+ { x: 0.314285, y: 79.7092, label: 'Opus 5 · max', color: 'warning', size: 7 },
18
+ ]
19
+
20
+ export function create(theme: ThemeMode = 'dark') {
21
+ const c = getThemeColors(theme)
22
+
23
+ return (
24
+ <Scene
25
+ c={c}
26
+ title="Desired-quadrant decision map"
27
+ subtitle="Turn two continuous metrics into explicit selection regions"
28
+ background={c.bg}
29
+ padding={20}
30
+ gap={14}
31
+ align="center"
32
+ >
33
+ <QuadrantChart
34
+ c={c}
35
+ width={960}
36
+ height={300}
37
+ title="Price × score selection policy"
38
+ subtitle="Green region satisfies both operating thresholds"
39
+ xMin={0}
40
+ xMax={0.4}
41
+ yMin={40}
42
+ yMax={100}
43
+ xThreshold={0.2}
44
+ yThreshold={70}
45
+ xAxisLabel="recorded cost per task"
46
+ formatX={(value) => `$${value.toFixed(2)}`}
47
+ formatY={(value) => `${Math.round(value)}`}
48
+ showTicks
49
+ showGrid
50
+ regions={{
51
+ topLeft: {
52
+ label: 'MOST DESIRED',
53
+ detail: 'score ≥ 70 · cost ≤ $0.20',
54
+ color: 'positive',
55
+ emphasis: true,
56
+ },
57
+ topRight: {
58
+ label: 'PREMIUM PERFORMANCE',
59
+ detail: 'high score · higher cost',
60
+ color: 'warning',
61
+ },
62
+ bottomLeft: {
63
+ label: 'BUDGET TRADEOFF',
64
+ detail: 'lower score · lower cost',
65
+ color: 'info',
66
+ },
67
+ bottomRight: {
68
+ label: 'LOW EFFICIENCY',
69
+ detail: 'lower score · higher cost',
70
+ color: 'critical',
71
+ },
72
+ }}
73
+ points={points}
74
+ footer="Threshold axes: cost ≤ $0.20 and weighted score ≥ 70"
75
+ />
76
+ </Scene>
77
+ )
78
+ }
79
+
80
+ export default create('dark')