@baron1996/kline-scene-schema 0.1.0 → 0.2.1

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.
@@ -26,7 +26,7 @@ export interface ChartScene {
26
26
  export interface RuntimeIdentity {
27
27
  engine: 'klinecharts';
28
28
  engineVersion: '10.0.0';
29
- runtimeVersion: '0.1.0';
29
+ runtimeVersion: '0.1.0' | '0.2.0';
30
30
  }
31
31
  export interface Symbol {
32
32
  ticker: string;
@@ -101,6 +101,7 @@ export interface ScenePane {
101
101
  export interface YAxis {
102
102
  id: string;
103
103
  role: 'primary' | 'additional';
104
+ scale?: 'linear' | 'logarithmic';
104
105
  position: 'left' | 'right';
105
106
  reverse: boolean;
106
107
  inside: boolean;
@@ -149,7 +150,7 @@ export interface Line {
149
150
  }
150
151
  export interface SceneOverlay {
151
152
  id: string;
152
- type: 'horizontalRayLine' | 'horizontalSegment' | 'horizontalStraightLine' | 'verticalRayLine' | 'verticalSegment' | 'verticalStraightLine' | 'rayLine' | 'segment' | 'straightLine' | 'priceLine' | 'priceChannelLine' | 'parallelStraightLine' | 'fibonacciLine' | 'brush' | 'simpleAnnotation' | 'simpleTag' | 'rectangle' | 'arrow' | 'crossLine' | 'callout' | 'text';
153
+ type: 'horizontalRayLine' | 'horizontalSegment' | 'horizontalStraightLine' | 'verticalRayLine' | 'verticalSegment' | 'verticalStraightLine' | 'rayLine' | 'segment' | 'straightLine' | 'priceLine' | 'priceChannelLine' | 'parallelStraightLine' | 'fibonacciLine' | 'brush' | 'simpleAnnotation' | 'simpleTag' | 'rectangle' | 'arrow' | 'crossLine' | 'callout' | 'text' | 'priceMeasurement';
153
154
  paneId: string;
154
155
  groupId?: string;
155
156
  visible: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"chart-scene.d.ts","sourceRoot":"","sources":["../../src/generated/chart-scene.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IAC1B,MAAM,EAAE,wBAAwB,CAAC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AE,GAAG,UAAU,CAAC;AACjE,MAAM,WAAW,UAAU;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;CACrC"}
@@ -139,7 +139,7 @@ export declare const RuntimeSchema: {
139
139
  readonly const: "10.0.0";
140
140
  };
141
141
  readonly runtimeVersion: {
142
- readonly const: "0.1.0";
142
+ readonly enum: readonly ["0.1.0", "0.2.0"];
143
143
  };
144
144
  };
145
145
  };
@@ -453,6 +453,9 @@ export declare const PaneSchema: {
453
453
  readonly role: {
454
454
  readonly enum: readonly ["primary", "additional"];
455
455
  };
456
+ readonly scale: {
457
+ readonly enum: readonly ["linear", "logarithmic"];
458
+ };
456
459
  readonly position: {
457
460
  readonly enum: readonly ["left", "right"];
458
461
  };
@@ -491,7 +494,7 @@ export declare const OverlaySchema: {
491
494
  readonly $ref: "https://baron.dev/kline-scene/common.schema.json#/$defs/stableId";
492
495
  };
493
496
  readonly type: {
494
- readonly enum: readonly ["horizontalRayLine", "horizontalSegment", "horizontalStraightLine", "verticalRayLine", "verticalSegment", "verticalStraightLine", "rayLine", "segment", "straightLine", "priceLine", "priceChannelLine", "parallelStraightLine", "fibonacciLine", "brush", "simpleAnnotation", "simpleTag", "rectangle", "arrow", "crossLine", "callout", "text"];
497
+ readonly enum: readonly ["horizontalRayLine", "horizontalSegment", "horizontalStraightLine", "verticalRayLine", "verticalSegment", "verticalStraightLine", "rayLine", "segment", "straightLine", "priceLine", "priceChannelLine", "parallelStraightLine", "fibonacciLine", "brush", "simpleAnnotation", "simpleTag", "rectangle", "arrow", "crossLine", "callout", "text", "priceMeasurement"];
495
498
  };
496
499
  readonly paneId: {
497
500
  readonly $ref: "https://baron.dev/kline-scene/common.schema.json#/$defs/stableId";
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/generated/schemas.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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qMnB,CAAC"}
@@ -174,7 +174,10 @@ export const RuntimeSchema = {
174
174
  "const": "10.0.0"
175
175
  },
176
176
  "runtimeVersion": {
177
- "const": "0.1.0"
177
+ "enum": [
178
+ "0.1.0",
179
+ "0.2.0"
180
+ ]
178
181
  }
179
182
  }
180
183
  };
@@ -626,6 +629,12 @@ export const PaneSchema = {
626
629
  "additional"
627
630
  ]
628
631
  },
632
+ "scale": {
633
+ "enum": [
634
+ "linear",
635
+ "logarithmic"
636
+ ]
637
+ },
629
638
  "position": {
630
639
  "enum": [
631
640
  "left",
@@ -697,7 +706,8 @@ export const OverlaySchema = {
697
706
  "arrow",
698
707
  "crossLine",
699
708
  "callout",
700
- "text"
709
+ "text",
710
+ "priceMeasurement"
701
711
  ]
702
712
  },
703
713
  "paneId": {
@@ -1 +1 @@
1
- {"version":3,"file":"validate-chart-scene.d.ts","sourceRoot":"","sources":["../../src/generated/validate-chart-scene.ts"],"names":[],"mappings":"AACa,eAAO,MAAM,kBAAkB,mBAAa,CAAC;AAA8z/K,iBAAS,UAAU,CAAC,IAAI,KAAA,EAAE,EAAC,YAAe,EAAE,UAAU,EAAE,kBAAkB,EAAE,QAAa,EAAE,cAAiB,EAAC;;;;CAAG,WAA89oB;kBAArkpB,UAAU"}
1
+ {"version":3,"file":"validate-chart-scene.d.ts","sourceRoot":"","sources":["../../src/generated/validate-chart-scene.ts"],"names":[],"mappings":"AACa,eAAO,MAAM,kBAAkB,mBAAa,CAAC;AAA0rgL,iBAAS,UAAU,CAAC,IAAI,KAAA,EAAE,EAAC,YAAe,EAAE,UAAU,EAAE,kBAAkB,EAAE,QAAa,EAAE,cAAiB,EAAC;;;;CAAG,WAA4jpB;kBAAnqpB,UAAU"}
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
  export const validateChartScene = validate20;
4
4
  const schema31 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://baron.dev/kline-scene/chart-scene.schema.json", "title": "ChartScene", "type": "object", "additionalProperties": false, "required": ["schema", "version", "runtime", "symbol", "period", "data", "chart", "panes", "overlays", "viewport", "render", "metadata"], "properties": { "schema": { "const": "@baron1996/kline-scene" }, "version": { "const": 1 }, "runtime": { "$ref": "https://baron.dev/kline-scene/runtime.schema.json" }, "symbol": { "$ref": "#/$defs/symbol" }, "period": { "$ref": "#/$defs/period" }, "data": { "type": "array", "minItems": 1, "maxItems": 1000000, "items": { "$ref": "https://baron.dev/kline-scene/market-data.schema.json" } }, "chart": { "$ref": "https://baron.dev/kline-scene/chart-config.schema.json" }, "panes": { "type": "array", "minItems": 1, "maxItems": 32, "items": { "$ref": "https://baron.dev/kline-scene/pane.schema.json" } }, "overlays": { "type": "array", "maxItems": 10000, "items": { "$ref": "https://baron.dev/kline-scene/overlay.schema.json" } }, "viewport": { "$ref": "#/$defs/viewport" }, "render": { "$ref": "#/$defs/render" }, "metadata": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/metadata" } }, "$defs": { "symbol": { "type": "object", "additionalProperties": false, "required": ["ticker", "pricePrecision", "volumePrecision"], "properties": { "ticker": { "type": "string", "minLength": 1, "maxLength": 128 }, "name": { "type": "string", "minLength": 1, "maxLength": 256 }, "pricePrecision": { "type": "integer", "minimum": 0, "maximum": 16 }, "volumePrecision": { "type": "integer", "minimum": 0, "maximum": 16 } } }, "period": { "type": "object", "additionalProperties": false, "required": ["span", "type"], "properties": { "span": { "type": "integer", "minimum": 1, "maximum": 100000 }, "type": { "enum": ["second", "minute", "hour", "day", "week", "month", "year"] } } }, "viewport": { "type": "object", "additionalProperties": false, "required": ["barSpace", "rightOffsetDistance", "anchorTimestamp"], "properties": { "barSpace": { "type": "number", "minimum": 1, "maximum": 100 }, "rightOffsetDistance": { "type": "number", "minimum": 0, "maximum": 10000 }, "anchorTimestamp": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/safeInteger" } } }, "render": { "type": "object", "additionalProperties": false, "required": ["width", "height", "deviceScaleFactor", "background", "fontFamily", "timeoutMs"], "properties": { "width": { "type": "integer", "minimum": 320, "maximum": 8192 }, "height": { "type": "integer", "minimum": 240, "maximum": 8192 }, "deviceScaleFactor": { "type": "number", "minimum": 0.5, "maximum": 4 }, "background": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/rgbaColor" }, "fontFamily": { "enum": ["Baron Sans"] }, "timeoutMs": { "type": "integer", "minimum": 100, "maximum": 120000 } } } } };
5
- const schema32 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://baron.dev/kline-scene/runtime.schema.json", "title": "RuntimeIdentity", "type": "object", "additionalProperties": false, "required": ["engine", "engineVersion", "runtimeVersion"], "properties": { "engine": { "const": "klinecharts" }, "engineVersion": { "const": "10.0.0" }, "runtimeVersion": { "const": "0.1.0" } } };
5
+ const schema32 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://baron.dev/kline-scene/runtime.schema.json", "title": "RuntimeIdentity", "type": "object", "additionalProperties": false, "required": ["engine", "engineVersion", "runtimeVersion"], "properties": { "engine": { "const": "klinecharts" }, "engineVersion": { "const": "10.0.0" }, "runtimeVersion": { "enum": ["0.1.0", "0.2.0"] } } };
6
6
  const schema33 = { "type": "object", "additionalProperties": false, "required": ["ticker", "pricePrecision", "volumePrecision"], "properties": { "ticker": { "type": "string", "minLength": 1, "maxLength": 128 }, "name": { "type": "string", "minLength": 1, "maxLength": 256 }, "pricePrecision": { "type": "integer", "minimum": 0, "maximum": 16 }, "volumePrecision": { "type": "integer", "minimum": 0, "maximum": 16 } } };
7
7
  const schema34 = { "type": "object", "additionalProperties": false, "required": ["span", "type"], "properties": { "span": { "type": "integer", "minimum": 1, "maximum": 100000 }, "type": { "enum": ["second", "minute", "hour", "day", "week", "month", "year"] } } };
8
8
  const func1 = Object.prototype.hasOwnProperty;
@@ -1355,10 +1355,10 @@ else {
1355
1355
  errors++;
1356
1356
  } validate24.errors = vErrors; return errors === 0; }
1357
1357
  validate24.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
1358
- const schema58 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://baron.dev/kline-scene/pane.schema.json", "title": "ScenePane", "type": "object", "additionalProperties": false, "required": ["id", "kind", "order", "height", "minHeight", "state", "yAxes", "indicators"], "properties": { "id": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/stableId" }, "kind": { "enum": ["candle", "indicator"] }, "order": { "type": "integer", "minimum": 0, "maximum": 128 }, "height": { "type": "integer", "minimum": 1, "maximum": 10000 }, "minHeight": { "type": "integer", "minimum": 1, "maximum": 10000 }, "state": { "enum": ["normal", "maximize", "minimize"] }, "yAxes": { "type": "array", "minItems": 1, "maxItems": 16, "items": { "$ref": "#/$defs/yAxis" } }, "indicators": { "type": "array", "maxItems": 128, "items": { "$ref": "https://baron.dev/kline-scene/indicator.schema.json" } } }, "$defs": { "yAxis": { "type": "object", "additionalProperties": false, "required": ["id", "role", "position", "reverse", "inside", "scrollZoomEnabled", "topGap", "bottomGap"], "properties": { "id": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/stableId" }, "role": { "enum": ["primary", "additional"] }, "position": { "enum": ["left", "right"] }, "reverse": { "type": "boolean" }, "inside": { "type": "boolean" }, "scrollZoomEnabled": { "type": "boolean" }, "topGap": { "type": "number", "minimum": 0, "maximum": 0.9 }, "bottomGap": { "type": "number", "minimum": 0, "maximum": 0.9 } } } } };
1358
+ const schema58 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://baron.dev/kline-scene/pane.schema.json", "title": "ScenePane", "type": "object", "additionalProperties": false, "required": ["id", "kind", "order", "height", "minHeight", "state", "yAxes", "indicators"], "properties": { "id": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/stableId" }, "kind": { "enum": ["candle", "indicator"] }, "order": { "type": "integer", "minimum": 0, "maximum": 128 }, "height": { "type": "integer", "minimum": 1, "maximum": 10000 }, "minHeight": { "type": "integer", "minimum": 1, "maximum": 10000 }, "state": { "enum": ["normal", "maximize", "minimize"] }, "yAxes": { "type": "array", "minItems": 1, "maxItems": 16, "items": { "$ref": "#/$defs/yAxis" } }, "indicators": { "type": "array", "maxItems": 128, "items": { "$ref": "https://baron.dev/kline-scene/indicator.schema.json" } } }, "$defs": { "yAxis": { "type": "object", "additionalProperties": false, "required": ["id", "role", "position", "reverse", "inside", "scrollZoomEnabled", "topGap", "bottomGap"], "properties": { "id": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/stableId" }, "role": { "enum": ["primary", "additional"] }, "scale": { "enum": ["linear", "logarithmic"] }, "position": { "enum": ["left", "right"] }, "reverse": { "type": "boolean" }, "inside": { "type": "boolean" }, "scrollZoomEnabled": { "type": "boolean" }, "topGap": { "type": "number", "minimum": 0, "maximum": 0.9 }, "bottomGap": { "type": "number", "minimum": 0, "maximum": 0.9 } } } } };
1359
1359
  const schema59 = { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z][A-Za-z0-9._:-]*$" };
1360
1360
  const pattern19 = new RegExp("^[A-Za-z][A-Za-z0-9._:-]*$", "u");
1361
- const schema60 = { "type": "object", "additionalProperties": false, "required": ["id", "role", "position", "reverse", "inside", "scrollZoomEnabled", "topGap", "bottomGap"], "properties": { "id": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/stableId" }, "role": { "enum": ["primary", "additional"] }, "position": { "enum": ["left", "right"] }, "reverse": { "type": "boolean" }, "inside": { "type": "boolean" }, "scrollZoomEnabled": { "type": "boolean" }, "topGap": { "type": "number", "minimum": 0, "maximum": 0.9 }, "bottomGap": { "type": "number", "minimum": 0, "maximum": 0.9 } } };
1361
+ const schema60 = { "type": "object", "additionalProperties": false, "required": ["id", "role", "position", "reverse", "inside", "scrollZoomEnabled", "topGap", "bottomGap"], "properties": { "id": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/stableId" }, "role": { "enum": ["primary", "additional"] }, "scale": { "enum": ["linear", "logarithmic"] }, "position": { "enum": ["left", "right"] }, "reverse": { "type": "boolean" }, "inside": { "type": "boolean" }, "scrollZoomEnabled": { "type": "boolean" }, "topGap": { "type": "number", "minimum": 0, "maximum": 0.9 }, "bottomGap": { "type": "number", "minimum": 0, "maximum": 0.9 } } };
1362
1362
  function validate27(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate27.evaluated; if (evaluated0.dynamicProps) {
1363
1363
  evaluated0.props = undefined;
1364
1364
  } if (evaluated0.dynamicItems) {
@@ -1445,7 +1445,7 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1445
1445
  errors++;
1446
1446
  }
1447
1447
  for (const key0 in data) {
1448
- if (!((((((((key0 === "id") || (key0 === "role")) || (key0 === "position")) || (key0 === "reverse")) || (key0 === "inside")) || (key0 === "scrollZoomEnabled")) || (key0 === "topGap")) || (key0 === "bottomGap"))) {
1448
+ if (!(func1.call(schema60.properties, key0))) {
1449
1449
  const err8 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
1450
1450
  if (vErrors === null) {
1451
1451
  vErrors = [err8];
@@ -1514,10 +1514,10 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1514
1514
  errors++;
1515
1515
  }
1516
1516
  }
1517
- if (data.position !== undefined) {
1518
- let data2 = data.position;
1519
- if (!((data2 === "left") || (data2 === "right"))) {
1520
- const err14 = { instancePath: instancePath + "/position", schemaPath: "#/properties/position/enum", keyword: "enum", params: { allowedValues: schema60.properties.position.enum }, message: "must be equal to one of the allowed values" };
1517
+ if (data.scale !== undefined) {
1518
+ let data2 = data.scale;
1519
+ if (!((data2 === "linear") || (data2 === "logarithmic"))) {
1520
+ const err14 = { instancePath: instancePath + "/scale", schemaPath: "#/properties/scale/enum", keyword: "enum", params: { allowedValues: schema60.properties.scale.enum }, message: "must be equal to one of the allowed values" };
1521
1521
  if (vErrors === null) {
1522
1522
  vErrors = [err14];
1523
1523
  }
@@ -1527,9 +1527,10 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1527
1527
  errors++;
1528
1528
  }
1529
1529
  }
1530
- if (data.reverse !== undefined) {
1531
- if (typeof data.reverse !== "boolean") {
1532
- const err15 = { instancePath: instancePath + "/reverse", schemaPath: "#/properties/reverse/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
1530
+ if (data.position !== undefined) {
1531
+ let data3 = data.position;
1532
+ if (!((data3 === "left") || (data3 === "right"))) {
1533
+ const err15 = { instancePath: instancePath + "/position", schemaPath: "#/properties/position/enum", keyword: "enum", params: { allowedValues: schema60.properties.position.enum }, message: "must be equal to one of the allowed values" };
1533
1534
  if (vErrors === null) {
1534
1535
  vErrors = [err15];
1535
1536
  }
@@ -1539,9 +1540,9 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1539
1540
  errors++;
1540
1541
  }
1541
1542
  }
1542
- if (data.inside !== undefined) {
1543
- if (typeof data.inside !== "boolean") {
1544
- const err16 = { instancePath: instancePath + "/inside", schemaPath: "#/properties/inside/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
1543
+ if (data.reverse !== undefined) {
1544
+ if (typeof data.reverse !== "boolean") {
1545
+ const err16 = { instancePath: instancePath + "/reverse", schemaPath: "#/properties/reverse/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
1545
1546
  if (vErrors === null) {
1546
1547
  vErrors = [err16];
1547
1548
  }
@@ -1551,9 +1552,9 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1551
1552
  errors++;
1552
1553
  }
1553
1554
  }
1554
- if (data.scrollZoomEnabled !== undefined) {
1555
- if (typeof data.scrollZoomEnabled !== "boolean") {
1556
- const err17 = { instancePath: instancePath + "/scrollZoomEnabled", schemaPath: "#/properties/scrollZoomEnabled/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
1555
+ if (data.inside !== undefined) {
1556
+ if (typeof data.inside !== "boolean") {
1557
+ const err17 = { instancePath: instancePath + "/inside", schemaPath: "#/properties/inside/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
1557
1558
  if (vErrors === null) {
1558
1559
  vErrors = [err17];
1559
1560
  }
@@ -1563,84 +1564,96 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1563
1564
  errors++;
1564
1565
  }
1565
1566
  }
1567
+ if (data.scrollZoomEnabled !== undefined) {
1568
+ if (typeof data.scrollZoomEnabled !== "boolean") {
1569
+ const err18 = { instancePath: instancePath + "/scrollZoomEnabled", schemaPath: "#/properties/scrollZoomEnabled/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
1570
+ if (vErrors === null) {
1571
+ vErrors = [err18];
1572
+ }
1573
+ else {
1574
+ vErrors.push(err18);
1575
+ }
1576
+ errors++;
1577
+ }
1578
+ }
1566
1579
  if (data.topGap !== undefined) {
1567
- let data6 = data.topGap;
1568
- if ((typeof data6 == "number") && (isFinite(data6))) {
1569
- if (data6 > 0.9 || isNaN(data6)) {
1570
- const err18 = { instancePath: instancePath + "/topGap", schemaPath: "#/properties/topGap/maximum", keyword: "maximum", params: { comparison: "<=", limit: 0.9 }, message: "must be <= 0.9" };
1580
+ let data7 = data.topGap;
1581
+ if ((typeof data7 == "number") && (isFinite(data7))) {
1582
+ if (data7 > 0.9 || isNaN(data7)) {
1583
+ const err19 = { instancePath: instancePath + "/topGap", schemaPath: "#/properties/topGap/maximum", keyword: "maximum", params: { comparison: "<=", limit: 0.9 }, message: "must be <= 0.9" };
1571
1584
  if (vErrors === null) {
1572
- vErrors = [err18];
1585
+ vErrors = [err19];
1573
1586
  }
1574
1587
  else {
1575
- vErrors.push(err18);
1588
+ vErrors.push(err19);
1576
1589
  }
1577
1590
  errors++;
1578
1591
  }
1579
- if (data6 < 0 || isNaN(data6)) {
1580
- const err19 = { instancePath: instancePath + "/topGap", schemaPath: "#/properties/topGap/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
1592
+ if (data7 < 0 || isNaN(data7)) {
1593
+ const err20 = { instancePath: instancePath + "/topGap", schemaPath: "#/properties/topGap/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
1581
1594
  if (vErrors === null) {
1582
- vErrors = [err19];
1595
+ vErrors = [err20];
1583
1596
  }
1584
1597
  else {
1585
- vErrors.push(err19);
1598
+ vErrors.push(err20);
1586
1599
  }
1587
1600
  errors++;
1588
1601
  }
1589
1602
  }
1590
1603
  else {
1591
- const err20 = { instancePath: instancePath + "/topGap", schemaPath: "#/properties/topGap/type", keyword: "type", params: { type: "number" }, message: "must be number" };
1604
+ const err21 = { instancePath: instancePath + "/topGap", schemaPath: "#/properties/topGap/type", keyword: "type", params: { type: "number" }, message: "must be number" };
1592
1605
  if (vErrors === null) {
1593
- vErrors = [err20];
1606
+ vErrors = [err21];
1594
1607
  }
1595
1608
  else {
1596
- vErrors.push(err20);
1609
+ vErrors.push(err21);
1597
1610
  }
1598
1611
  errors++;
1599
1612
  }
1600
1613
  }
1601
1614
  if (data.bottomGap !== undefined) {
1602
- let data7 = data.bottomGap;
1603
- if ((typeof data7 == "number") && (isFinite(data7))) {
1604
- if (data7 > 0.9 || isNaN(data7)) {
1605
- const err21 = { instancePath: instancePath + "/bottomGap", schemaPath: "#/properties/bottomGap/maximum", keyword: "maximum", params: { comparison: "<=", limit: 0.9 }, message: "must be <= 0.9" };
1615
+ let data8 = data.bottomGap;
1616
+ if ((typeof data8 == "number") && (isFinite(data8))) {
1617
+ if (data8 > 0.9 || isNaN(data8)) {
1618
+ const err22 = { instancePath: instancePath + "/bottomGap", schemaPath: "#/properties/bottomGap/maximum", keyword: "maximum", params: { comparison: "<=", limit: 0.9 }, message: "must be <= 0.9" };
1606
1619
  if (vErrors === null) {
1607
- vErrors = [err21];
1620
+ vErrors = [err22];
1608
1621
  }
1609
1622
  else {
1610
- vErrors.push(err21);
1623
+ vErrors.push(err22);
1611
1624
  }
1612
1625
  errors++;
1613
1626
  }
1614
- if (data7 < 0 || isNaN(data7)) {
1615
- const err22 = { instancePath: instancePath + "/bottomGap", schemaPath: "#/properties/bottomGap/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
1627
+ if (data8 < 0 || isNaN(data8)) {
1628
+ const err23 = { instancePath: instancePath + "/bottomGap", schemaPath: "#/properties/bottomGap/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
1616
1629
  if (vErrors === null) {
1617
- vErrors = [err22];
1630
+ vErrors = [err23];
1618
1631
  }
1619
1632
  else {
1620
- vErrors.push(err22);
1633
+ vErrors.push(err23);
1621
1634
  }
1622
1635
  errors++;
1623
1636
  }
1624
1637
  }
1625
1638
  else {
1626
- const err23 = { instancePath: instancePath + "/bottomGap", schemaPath: "#/properties/bottomGap/type", keyword: "type", params: { type: "number" }, message: "must be number" };
1639
+ const err24 = { instancePath: instancePath + "/bottomGap", schemaPath: "#/properties/bottomGap/type", keyword: "type", params: { type: "number" }, message: "must be number" };
1627
1640
  if (vErrors === null) {
1628
- vErrors = [err23];
1641
+ vErrors = [err24];
1629
1642
  }
1630
1643
  else {
1631
- vErrors.push(err23);
1644
+ vErrors.push(err24);
1632
1645
  }
1633
1646
  errors++;
1634
1647
  }
1635
1648
  }
1636
1649
  }
1637
1650
  else {
1638
- const err24 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
1651
+ const err25 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
1639
1652
  if (vErrors === null) {
1640
- vErrors = [err24];
1653
+ vErrors = [err25];
1641
1654
  }
1642
1655
  else {
1643
- vErrors.push(err24);
1656
+ vErrors.push(err25);
1644
1657
  }
1645
1658
  errors++;
1646
1659
  } validate27.errors = vErrors; return errors === 0; }
@@ -2928,7 +2941,7 @@ else {
2928
2941
  errors++;
2929
2942
  } validate26.errors = vErrors; return errors === 0; }
2930
2943
  validate26.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
2931
- const schema72 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://baron.dev/kline-scene/overlay.schema.json", "title": "SceneOverlay", "type": "object", "additionalProperties": false, "required": ["id", "type", "paneId", "visible", "locked", "zLevel", "mode", "styles"], "properties": { "id": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/stableId" }, "type": { "enum": ["horizontalRayLine", "horizontalSegment", "horizontalStraightLine", "verticalRayLine", "verticalSegment", "verticalStraightLine", "rayLine", "segment", "straightLine", "priceLine", "priceChannelLine", "parallelStraightLine", "fibonacciLine", "brush", "simpleAnnotation", "simpleTag", "rectangle", "arrow", "crossLine", "callout", "text"] }, "paneId": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/stableId" }, "groupId": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/stableId" }, "visible": { "type": "boolean" }, "locked": { "type": "boolean" }, "zLevel": { "type": "integer", "minimum": -1000, "maximum": 1000 }, "mode": { "enum": ["normal", "weak_magnet", "strong_magnet"] }, "anchor": { "oneOf": [{ "$ref": "#/$defs/timeAnchor" }, { "$ref": "#/$defs/valueAnchor" }, { "$ref": "#/$defs/timeValueAnchor" }] }, "value": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/finiteNumber" }, "startTimestamp": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/safeInteger" }, "endTimestamp": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/safeInteger" }, "timestamp": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/safeInteger" }, "startValue": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/finiteNumber" }, "endValue": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/finiteNumber" }, "point": { "$ref": "#/$defs/timeValueAnchor" }, "start": { "$ref": "#/$defs/timeValueAnchor" }, "end": { "$ref": "#/$defs/timeValueAnchor" }, "points": { "type": "array", "minItems": 1, "maxItems": 256, "items": { "$ref": "#/$defs/timeValueAnchor" } }, "text": { "type": "string", "maxLength": 4096 }, "styles": { "type": "object", "additionalProperties": false, "required": ["line", "fill", "text"], "properties": { "line": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/lineStyle" }, "fill": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/fillStyle" }, "text": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/textStyle" } } }, "metadata": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/metadata" } }, "$defs": { "timeAnchor": { "type": "object", "additionalProperties": false, "required": ["timestamp"], "properties": { "timestamp": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/safeInteger" } } }, "valueAnchor": { "type": "object", "additionalProperties": false, "required": ["value"], "properties": { "value": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/finiteNumber" } } }, "timeValueAnchor": { "type": "object", "additionalProperties": false, "required": ["timestamp", "value"], "properties": { "timestamp": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/safeInteger" }, "value": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/finiteNumber" } } } } };
2944
+ const schema72 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://baron.dev/kline-scene/overlay.schema.json", "title": "SceneOverlay", "type": "object", "additionalProperties": false, "required": ["id", "type", "paneId", "visible", "locked", "zLevel", "mode", "styles"], "properties": { "id": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/stableId" }, "type": { "enum": ["horizontalRayLine", "horizontalSegment", "horizontalStraightLine", "verticalRayLine", "verticalSegment", "verticalStraightLine", "rayLine", "segment", "straightLine", "priceLine", "priceChannelLine", "parallelStraightLine", "fibonacciLine", "brush", "simpleAnnotation", "simpleTag", "rectangle", "arrow", "crossLine", "callout", "text", "priceMeasurement"] }, "paneId": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/stableId" }, "groupId": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/stableId" }, "visible": { "type": "boolean" }, "locked": { "type": "boolean" }, "zLevel": { "type": "integer", "minimum": -1000, "maximum": 1000 }, "mode": { "enum": ["normal", "weak_magnet", "strong_magnet"] }, "anchor": { "oneOf": [{ "$ref": "#/$defs/timeAnchor" }, { "$ref": "#/$defs/valueAnchor" }, { "$ref": "#/$defs/timeValueAnchor" }] }, "value": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/finiteNumber" }, "startTimestamp": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/safeInteger" }, "endTimestamp": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/safeInteger" }, "timestamp": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/safeInteger" }, "startValue": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/finiteNumber" }, "endValue": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/finiteNumber" }, "point": { "$ref": "#/$defs/timeValueAnchor" }, "start": { "$ref": "#/$defs/timeValueAnchor" }, "end": { "$ref": "#/$defs/timeValueAnchor" }, "points": { "type": "array", "minItems": 1, "maxItems": 256, "items": { "$ref": "#/$defs/timeValueAnchor" } }, "text": { "type": "string", "maxLength": 4096 }, "styles": { "type": "object", "additionalProperties": false, "required": ["line", "fill", "text"], "properties": { "line": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/lineStyle" }, "fill": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/fillStyle" }, "text": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/textStyle" } } }, "metadata": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/metadata" } }, "$defs": { "timeAnchor": { "type": "object", "additionalProperties": false, "required": ["timestamp"], "properties": { "timestamp": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/safeInteger" } } }, "valueAnchor": { "type": "object", "additionalProperties": false, "required": ["value"], "properties": { "value": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/finiteNumber" } } }, "timeValueAnchor": { "type": "object", "additionalProperties": false, "required": ["timestamp", "value"], "properties": { "timestamp": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/safeInteger" }, "value": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/finiteNumber" } } } } };
2932
2945
  const schema76 = { "type": "object", "additionalProperties": false, "required": ["timestamp"], "properties": { "timestamp": { "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/safeInteger" } } };
2933
2946
  function validate35(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate35.evaluated; if (evaluated0.dynamicProps) {
2934
2947
  evaluated0.props = undefined;
@@ -4114,7 +4127,7 @@ function validate34(data, { instancePath = "", parentData, parentDataProperty, r
4114
4127
  }
4115
4128
  if (data.type !== undefined) {
4116
4129
  let data1 = data.type;
4117
- if (!(((((((((((((((((((((data1 === "horizontalRayLine") || (data1 === "horizontalSegment")) || (data1 === "horizontalStraightLine")) || (data1 === "verticalRayLine")) || (data1 === "verticalSegment")) || (data1 === "verticalStraightLine")) || (data1 === "rayLine")) || (data1 === "segment")) || (data1 === "straightLine")) || (data1 === "priceLine")) || (data1 === "priceChannelLine")) || (data1 === "parallelStraightLine")) || (data1 === "fibonacciLine")) || (data1 === "brush")) || (data1 === "simpleAnnotation")) || (data1 === "simpleTag")) || (data1 === "rectangle")) || (data1 === "arrow")) || (data1 === "crossLine")) || (data1 === "callout")) || (data1 === "text"))) {
4130
+ if (!((((((((((((((((((((((data1 === "horizontalRayLine") || (data1 === "horizontalSegment")) || (data1 === "horizontalStraightLine")) || (data1 === "verticalRayLine")) || (data1 === "verticalSegment")) || (data1 === "verticalStraightLine")) || (data1 === "rayLine")) || (data1 === "segment")) || (data1 === "straightLine")) || (data1 === "priceLine")) || (data1 === "priceChannelLine")) || (data1 === "parallelStraightLine")) || (data1 === "fibonacciLine")) || (data1 === "brush")) || (data1 === "simpleAnnotation")) || (data1 === "simpleTag")) || (data1 === "rectangle")) || (data1 === "arrow")) || (data1 === "crossLine")) || (data1 === "callout")) || (data1 === "text")) || (data1 === "priceMeasurement"))) {
4118
4131
  const err13 = { instancePath: instancePath + "/type", schemaPath: "#/properties/type/enum", keyword: "enum", params: { allowedValues: schema72.properties.type.enum }, message: "must be equal to one of the allowed values" };
4119
4132
  if (vErrors === null) {
4120
4133
  vErrors = [err13];
@@ -5447,8 +5460,9 @@ function validate20(data, { instancePath = "", parentData, parentDataProperty, r
5447
5460
  }
5448
5461
  }
5449
5462
  if (data2.runtimeVersion !== undefined) {
5450
- if ("0.1.0" !== data2.runtimeVersion) {
5451
- const err21 = { instancePath: instancePath + "/runtime/runtimeVersion", schemaPath: "https://baron.dev/kline-scene/runtime.schema.json/properties/runtimeVersion/const", keyword: "const", params: { allowedValue: "0.1.0" }, message: "must be equal to constant" };
5463
+ let data5 = data2.runtimeVersion;
5464
+ if (!((data5 === "0.1.0") || (data5 === "0.2.0"))) {
5465
+ const err21 = { instancePath: instancePath + "/runtime/runtimeVersion", schemaPath: "https://baron.dev/kline-scene/runtime.schema.json/properties/runtimeVersion/enum", keyword: "enum", params: { allowedValues: schema32.properties.runtimeVersion.enum }, message: "must be equal to one of the allowed values" };
5452
5466
  if (vErrors === null) {
5453
5467
  vErrors = [err21];
5454
5468
  }
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- /** 场景协议包版本,与首版 Runtime 版本保持一致。 */
2
- export declare const SCENE_PACKAGE_VERSION: "0.1.0";
1
+ /** 场景协议包版本;Scene version 仍保持 1。 */
2
+ export declare const SCENE_PACKAGE_VERSION: "0.2.1";
3
3
  export * from './canonical-json.js';
4
4
  export * from './canonicalize.js';
5
5
  export * from './errors.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,eAAO,MAAM,qBAAqB,EAAG,OAAgB,CAAC;AAEtD,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,eAAO,MAAM,qBAAqB,EAAG,OAAgB,CAAC;AAEtD,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- /** 场景协议包版本,与首版 Runtime 版本保持一致。 */
2
- export const SCENE_PACKAGE_VERSION = '0.1.0';
1
+ /** 场景协议包版本;Scene version 仍保持 1。 */
2
+ export const SCENE_PACKAGE_VERSION = '0.2.1';
3
3
  export * from './canonical-json.js';
4
4
  export * from './canonicalize.js';
5
5
  export * from './errors.js';
@@ -1 +1 @@
1
- {"version":3,"file":"semantic-validator.d.ts","sourceRoot":"","sources":["../src/semantic-validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,UAAU,EAIV,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAmC,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAgY/E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,UAAU,EAAE,CAM9E;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAM3D"}
1
+ {"version":3,"file":"semantic-validator.d.ts","sourceRoot":"","sources":["../src/semantic-validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,UAAU,EAIV,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAmC,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAiiB/E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,UAAU,EAAE,CAM9E;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAM3D"}
@@ -56,6 +56,8 @@ function assertUnique(values, path, label, issues) {
56
56
  }
57
57
  }
58
58
  function validateMarketData(scene, issues) {
59
+ const candlePane = scene.panes.find((pane) => pane.kind === 'candle');
60
+ const logarithmic = candlePane?.yAxes.some((axis) => axis.role === 'primary' && axis.scale === 'logarithmic') ?? false;
59
61
  let previousTimestamp = -Infinity;
60
62
  for (let index = 0; index < scene.data.length; index++) {
61
63
  const bar = scene.data[index];
@@ -77,6 +79,10 @@ function validateMarketData(scene, issues) {
77
79
  bar.close > bar.high) {
78
80
  issues.push(issue('INVALID_MARKET_DATA', path, 'OHLC values must satisfy low <= open/close <= high.'));
79
81
  }
82
+ if (logarithmic &&
83
+ (bar.open <= 0 || bar.high <= 0 || bar.low <= 0 || bar.close <= 0)) {
84
+ issues.push(issue('INVALID_MARKET_DATA', path, 'Logarithmic candle OHLC values must all be greater than zero.'));
85
+ }
80
86
  }
81
87
  if (!scene.data.some((bar) => bar.timestamp === scene.viewport.anchorTimestamp)) {
82
88
  issues.push(issue('INVALID_REFERENCE', '/viewport/anchorTimestamp', 'Viewport anchorTimestamp must reference an embedded market-data bar.'));
@@ -125,9 +131,24 @@ function validatePanes(scene, issues) {
125
131
  }
126
132
  for (let axisIndex = 0; axisIndex < pane.yAxes.length; axisIndex++) {
127
133
  const axis = pane.yAxes[axisIndex];
134
+ const axisPath = `${path}/yAxes/${axisIndex}`;
128
135
  if (axis !== undefined && axis.topGap + axis.bottomGap >= 1) {
129
136
  issues.push(issue('SCENE_SCHEMA_INVALID', `${path}/yAxes/${axisIndex}`, 'Y-axis topGap + bottomGap must be less than 1.'));
130
137
  }
138
+ if (axis === undefined) {
139
+ continue;
140
+ }
141
+ if (scene.runtime.runtimeVersion === '0.1.0' && axis.scale !== undefined) {
142
+ issues.push(issue('SCENE_SCHEMA_INVALID', `${axisPath}/scale`, 'Runtime 0.1.0 Y-axes must omit scale to preserve M1 canonical bytes.'));
143
+ }
144
+ if (scene.runtime.runtimeVersion === '0.2.0' && axis.scale === undefined) {
145
+ issues.push(issue('SCENE_SCHEMA_INVALID', `${axisPath}/scale`, 'Runtime 0.2.0 requires an explicit scale on every Y-axis.'));
146
+ }
147
+ if (scene.runtime.runtimeVersion === '0.2.0' &&
148
+ !(pane.kind === 'candle' && axis.role === 'primary') &&
149
+ axis.scale !== 'linear') {
150
+ issues.push(issue('SCENE_SCHEMA_INVALID', `${axisPath}/scale`, 'Only the candle primary Y-axis may use logarithmic scale.'));
151
+ }
131
152
  }
132
153
  if (pane.kind === 'indicator') {
133
154
  if (pane.indicators.length === 0) {
@@ -228,6 +249,9 @@ function validateOverlayShape(overlay, path, issues) {
228
249
  case 'arrow':
229
250
  requireOverlayKeys(overlay, path, ['start', 'end'], issues);
230
251
  break;
252
+ case 'priceMeasurement':
253
+ requireOverlayKeys(overlay, path, ['start', 'end'], issues);
254
+ break;
231
255
  case 'crossLine':
232
256
  requireOverlayKeys(overlay, path, ['point'], issues);
233
257
  break;
@@ -236,6 +260,10 @@ function validateOverlayShape(overlay, path, issues) {
236
260
  function validateOverlays(scene, issues) {
237
261
  assertUnique(scene.overlays.map((overlay) => overlay.id), '/overlays', 'Overlay', issues);
238
262
  const paneIds = new Set(scene.panes.map((pane) => pane.id));
263
+ const candlePane = scene.panes.find((pane) => pane.kind === 'candle');
264
+ const candlePaneId = candlePane?.id;
265
+ const logarithmic = candlePane?.yAxes.some((axis) => axis.role === 'primary' && axis.scale === 'logarithmic') ?? false;
266
+ const timestamps = new Set(scene.data.map((bar) => bar.timestamp));
239
267
  for (let index = 0; index < scene.overlays.length; index++) {
240
268
  const overlay = scene.overlays[index];
241
269
  if (overlay === undefined) {
@@ -246,7 +274,79 @@ function validateOverlays(scene, issues) {
246
274
  issues.push(issue('INVALID_REFERENCE', `${path}/paneId`, 'Overlay paneId does not exist.'));
247
275
  }
248
276
  validateOverlayShape(overlay, path, issues);
277
+ if (scene.runtime.runtimeVersion === '0.1.0' && overlay.type === 'priceMeasurement') {
278
+ issues.push(issue('SCENE_SCHEMA_INVALID', `${path}/type`, 'Runtime 0.1.0 does not support priceMeasurement.'));
279
+ }
280
+ for (const coordinate of overlayPriceCoordinates(overlay, path)) {
281
+ if ((overlay.type === 'priceMeasurement' ||
282
+ (logarithmic && overlay.paneId === candlePaneId)) &&
283
+ coordinate.value <= 0) {
284
+ issues.push(issue('SCENE_SCHEMA_INVALID', coordinate.path, overlay.type === 'priceMeasurement'
285
+ ? 'priceMeasurement values must be greater than zero.'
286
+ : 'Logarithmic Overlay price coordinates must be greater than zero.'));
287
+ }
288
+ }
289
+ if (overlay.type === 'priceMeasurement') {
290
+ for (const key of ['start', 'end']) {
291
+ const point = overlay[key];
292
+ if (point !== undefined && !timestamps.has(point.timestamp)) {
293
+ issues.push(issue('INVALID_REFERENCE', `${path}/${key}/timestamp`, 'priceMeasurement timestamps must reference embedded market-data bars.'));
294
+ }
295
+ }
296
+ }
297
+ }
298
+ }
299
+ function overlayPriceCoordinates(overlay, path) {
300
+ const result = [];
301
+ const add = (value, valuePath) => {
302
+ if (value !== undefined) {
303
+ result.push({ path: valuePath, value });
304
+ }
305
+ };
306
+ switch (overlay.type) {
307
+ case 'horizontalStraightLine':
308
+ case 'priceLine':
309
+ case 'simpleTag': {
310
+ const anchor = overlay.anchor;
311
+ add(anchor !== undefined && 'value' in anchor ? anchor.value : undefined, `${path}/anchor/value`);
312
+ break;
313
+ }
314
+ case 'horizontalRayLine':
315
+ case 'horizontalSegment':
316
+ add(overlay.value, `${path}/value`);
317
+ break;
318
+ case 'verticalRayLine':
319
+ case 'verticalSegment':
320
+ add(overlay.startValue, `${path}/startValue`);
321
+ add(overlay.endValue, `${path}/endValue`);
322
+ break;
323
+ case 'rayLine':
324
+ case 'segment':
325
+ case 'straightLine':
326
+ case 'fibonacciLine':
327
+ case 'priceChannelLine':
328
+ case 'parallelStraightLine':
329
+ case 'brush':
330
+ for (let index = 0; index < (overlay.points?.length ?? 0); index++) {
331
+ add(overlay.points?.[index]?.value, `${path}/points/${index}/value`);
332
+ }
333
+ break;
334
+ case 'simpleAnnotation':
335
+ case 'crossLine':
336
+ case 'callout':
337
+ case 'text':
338
+ add(overlay.point?.value, `${path}/point/value`);
339
+ break;
340
+ case 'rectangle':
341
+ case 'arrow':
342
+ case 'priceMeasurement':
343
+ add(overlay.start?.value, `${path}/start/value`);
344
+ add(overlay.end?.value, `${path}/end/value`);
345
+ break;
346
+ case 'verticalStraightLine':
347
+ break;
249
348
  }
349
+ return result;
250
350
  }
251
351
  export function collectSemanticIssues(scene) {
252
352
  const issues = [];
package/dist/version.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export declare const SCENE_SCHEMA_NAME: "@baron1996/kline-scene";
2
2
  export declare const SCENE_SCHEMA_VERSION: 1;
3
3
  export declare const KLINECHARTS_ENGINE_VERSION: "10.0.0";
4
- export declare const SCENE_RUNTIME_VERSION: "0.1.0";
4
+ export declare const M1_SCENE_RUNTIME_VERSION: "0.1.0";
5
+ export declare const SCENE_RUNTIME_VERSION: "0.2.0";
6
+ export declare const SUPPORTED_SCENE_RUNTIME_VERSIONS: readonly ["0.1.0", "0.2.0"];
5
7
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,EAAG,wBAAiC,CAAC;AACnE,eAAO,MAAM,oBAAoB,EAAG,CAAU,CAAC;AAC/C,eAAO,MAAM,0BAA0B,EAAG,QAAiB,CAAC;AAC5D,eAAO,MAAM,qBAAqB,EAAG,OAAgB,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,EAAG,wBAAiC,CAAC;AACnE,eAAO,MAAM,oBAAoB,EAAG,CAAU,CAAC;AAC/C,eAAO,MAAM,0BAA0B,EAAG,QAAiB,CAAC;AAC5D,eAAO,MAAM,wBAAwB,EAAG,OAAgB,CAAC;AACzD,eAAO,MAAM,qBAAqB,EAAG,OAAgB,CAAC;AACtD,eAAO,MAAM,gCAAgC,6BAGnC,CAAC"}
package/dist/version.js CHANGED
@@ -1,4 +1,9 @@
1
1
  export const SCENE_SCHEMA_NAME = '@baron1996/kline-scene';
2
2
  export const SCENE_SCHEMA_VERSION = 1;
3
3
  export const KLINECHARTS_ENGINE_VERSION = '10.0.0';
4
- export const SCENE_RUNTIME_VERSION = '0.1.0';
4
+ export const M1_SCENE_RUNTIME_VERSION = '0.1.0';
5
+ export const SCENE_RUNTIME_VERSION = '0.2.0';
6
+ export const SUPPORTED_SCENE_RUNTIME_VERSIONS = [
7
+ M1_SCENE_RUNTIME_VERSION,
8
+ SCENE_RUNTIME_VERSION,
9
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baron1996/kline-scene-schema",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "Strict ChartScene schema, types, validation, and canonical serialization.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -40,7 +40,8 @@
40
40
  "arrow",
41
41
  "crossLine",
42
42
  "callout",
43
- "text"
43
+ "text",
44
+ "priceMeasurement"
44
45
  ]
45
46
  },
46
47
  "paneId": {
@@ -86,6 +86,12 @@
86
86
  "additional"
87
87
  ]
88
88
  },
89
+ "scale": {
90
+ "enum": [
91
+ "linear",
92
+ "logarithmic"
93
+ ]
94
+ },
89
95
  "position": {
90
96
  "enum": [
91
97
  "left",
@@ -17,7 +17,10 @@
17
17
  "const": "10.0.0"
18
18
  },
19
19
  "runtimeVersion": {
20
- "const": "0.1.0"
20
+ "enum": [
21
+ "0.1.0",
22
+ "0.2.0"
23
+ ]
21
24
  }
22
25
  }
23
26
  }