@baron1996/kline-scene-schema 0.2.3 → 0.4.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.
Files changed (85) hide show
  1. package/dist/decimal-normalization.d.ts +6 -0
  2. package/dist/decimal-normalization.d.ts.map +1 -0
  3. package/dist/decimal-normalization.js +47 -0
  4. package/dist/drawable-workspace-canonical-json.d.ts +3 -0
  5. package/dist/drawable-workspace-canonical-json.d.ts.map +1 -0
  6. package/dist/drawable-workspace-canonical-json.js +15 -0
  7. package/dist/drawable-workspace-canonicalize.d.ts +3 -0
  8. package/dist/drawable-workspace-canonicalize.d.ts.map +1 -0
  9. package/dist/drawable-workspace-canonicalize.js +19 -0
  10. package/dist/drawable-workspace-errors.d.ts +14 -0
  11. package/dist/drawable-workspace-errors.d.ts.map +1 -0
  12. package/dist/drawable-workspace-errors.js +12 -0
  13. package/dist/drawable-workspace-semantic-validator.d.ts +5 -0
  14. package/dist/drawable-workspace-semantic-validator.d.ts.map +1 -0
  15. package/dist/drawable-workspace-semantic-validator.js +127 -0
  16. package/dist/drawable-workspace-validator.d.ts +4 -0
  17. package/dist/drawable-workspace-validator.d.ts.map +1 -0
  18. package/dist/drawable-workspace-validator.js +74 -0
  19. package/dist/drawing-canonical-json.d.ts +3 -0
  20. package/dist/drawing-canonical-json.d.ts.map +1 -0
  21. package/dist/drawing-canonical-json.js +15 -0
  22. package/dist/drawing-canonicalize.d.ts +3 -0
  23. package/dist/drawing-canonicalize.d.ts.map +1 -0
  24. package/dist/drawing-canonicalize.js +19 -0
  25. package/dist/drawing-errors.d.ts +13 -0
  26. package/dist/drawing-errors.d.ts.map +1 -0
  27. package/dist/drawing-errors.js +12 -0
  28. package/dist/drawing-semantic-validator.d.ts +6 -0
  29. package/dist/drawing-semantic-validator.d.ts.map +1 -0
  30. package/dist/drawing-semantic-validator.js +123 -0
  31. package/dist/drawing-validator.d.ts +4 -0
  32. package/dist/drawing-validator.d.ts.map +1 -0
  33. package/dist/drawing-validator.js +66 -0
  34. package/dist/generated/chart-scene.d.ts +11 -1
  35. package/dist/generated/chart-scene.d.ts.map +1 -1
  36. package/dist/generated/drawable-workspace.d.ts +526 -0
  37. package/dist/generated/drawable-workspace.d.ts.map +1 -0
  38. package/dist/generated/drawable-workspace.js +2 -0
  39. package/dist/generated/drawing-document.d.ts +216 -0
  40. package/dist/generated/drawing-document.d.ts.map +1 -0
  41. package/dist/generated/drawing-document.js +2 -0
  42. package/dist/generated/schemas.d.ts +1062 -17
  43. package/dist/generated/schemas.d.ts.map +1 -1
  44. package/dist/generated/schemas.js +1391 -28
  45. package/dist/generated/time-series-scene.d.ts +88 -0
  46. package/dist/generated/time-series-scene.d.ts.map +1 -0
  47. package/dist/generated/time-series-scene.js +2 -0
  48. package/dist/generated/validate-chart-scene.d.ts.map +1 -1
  49. package/dist/generated/validate-chart-scene.js +550 -237
  50. package/dist/generated/validate-drawable-workspace.d.ts +15 -0
  51. package/dist/generated/validate-drawable-workspace.d.ts.map +1 -0
  52. package/dist/generated/validate-drawable-workspace.js +13449 -0
  53. package/dist/generated/validate-drawing-document.d.ts +15 -0
  54. package/dist/generated/validate-drawing-document.d.ts.map +1 -0
  55. package/dist/generated/validate-drawing-document.js +4307 -0
  56. package/dist/generated/validate-time-series-scene.d.ts +15 -0
  57. package/dist/generated/validate-time-series-scene.d.ts.map +1 -0
  58. package/dist/generated/validate-time-series-scene.js +2359 -0
  59. package/dist/index.d.ts +20 -1
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +19 -1
  62. package/dist/time-series-canonical-json.d.ts +3 -0
  63. package/dist/time-series-canonical-json.d.ts.map +1 -0
  64. package/dist/time-series-canonical-json.js +15 -0
  65. package/dist/time-series-canonicalize.d.ts +3 -0
  66. package/dist/time-series-canonicalize.d.ts.map +1 -0
  67. package/dist/time-series-canonicalize.js +19 -0
  68. package/dist/time-series-errors.d.ts +13 -0
  69. package/dist/time-series-errors.d.ts.map +1 -0
  70. package/dist/time-series-errors.js +12 -0
  71. package/dist/time-series-semantic-validator.d.ts +5 -0
  72. package/dist/time-series-semantic-validator.d.ts.map +1 -0
  73. package/dist/time-series-semantic-validator.js +81 -0
  74. package/dist/time-series-validator.d.ts +4 -0
  75. package/dist/time-series-validator.d.ts.map +1 -0
  76. package/dist/time-series-validator.js +52 -0
  77. package/package.json +1 -1
  78. package/schema/chart-config.schema.json +68 -1
  79. package/schema/chart-scene.schema.json +1 -27
  80. package/schema/common.schema.json +26 -0
  81. package/schema/drawable-workspace.schema.json +110 -0
  82. package/schema/drawing-document.schema.json +811 -0
  83. package/schema/time-series-chart-config.schema.json +75 -0
  84. package/schema/time-series-runtime.schema.json +13 -0
  85. package/schema/time-series-scene.schema.json +145 -0
@@ -0,0 +1,75 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://baron.dev/kline-scene/time-series-chart-config.schema.json",
4
+ "title": "TimeSeriesChartConfig",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "locale",
9
+ "timezone",
10
+ "layout",
11
+ "grid",
12
+ "thousandsSeparator",
13
+ "decimalFold",
14
+ "zoomAnchor",
15
+ "dateFormat",
16
+ "largeNumberFormat"
17
+ ],
18
+ "properties": {
19
+ "locale": {
20
+ "type": "string",
21
+ "minLength": 2,
22
+ "maxLength": 64,
23
+ "pattern": "^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$"
24
+ },
25
+ "timezone": {
26
+ "type": "string",
27
+ "minLength": 1,
28
+ "maxLength": 128,
29
+ "pattern": "^[A-Za-z_+-]+(?:/[A-Za-z0-9_+-]+)*$"
30
+ },
31
+ "layout": {
32
+ "type": "object",
33
+ "additionalProperties": false,
34
+ "required": ["backgroundColor", "textColor", "fontFamily", "fontSize"],
35
+ "properties": {
36
+ "backgroundColor": {
37
+ "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/rgbaColor"
38
+ },
39
+ "textColor": {
40
+ "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/rgbaColor"
41
+ },
42
+ "fontFamily": { "type": "string", "minLength": 1, "maxLength": 128 },
43
+ "fontSize": { "type": "number", "minimum": 8, "maximum": 32 }
44
+ }
45
+ },
46
+ "grid": {
47
+ "type": "object",
48
+ "additionalProperties": false,
49
+ "required": ["horizontalColor", "verticalColor"],
50
+ "properties": {
51
+ "horizontalColor": {
52
+ "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/rgbaColor"
53
+ },
54
+ "verticalColor": {
55
+ "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/rgbaColor"
56
+ }
57
+ }
58
+ },
59
+ "thousandsSeparator": { "enum": ["", ",", " ", "_"] },
60
+ "decimalFold": {
61
+ "type": "object",
62
+ "additionalProperties": false,
63
+ "required": ["enabled", "threshold"],
64
+ "properties": {
65
+ "enabled": { "type": "boolean" },
66
+ "threshold": { "type": "integer", "minimum": 1, "maximum": 16 }
67
+ }
68
+ },
69
+ "zoomAnchor": { "enum": ["cursor", "right"] },
70
+ "dateFormat": {
71
+ "enum": ["yyyy-MM-dd", "yyyy-MM-dd HH:mm", "yyyy-MM-dd HH:mm:ss"]
72
+ },
73
+ "largeNumberFormat": { "enum": ["western", "chinese", "plain"] }
74
+ }
75
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://baron.dev/kline-scene/time-series-runtime.schema.json",
4
+ "title": "TimeSeriesRuntimeIdentity",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["engine", "engineVersion", "runtimeVersion"],
8
+ "properties": {
9
+ "engine": { "const": "klinecharts" },
10
+ "engineVersion": { "const": "10.0.0" },
11
+ "runtimeVersion": { "const": "0.1.0" }
12
+ }
13
+ }
@@ -0,0 +1,145 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://baron.dev/kline-scene/time-series-scene.schema.json",
4
+ "title": "TimeSeriesScene",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema",
9
+ "version",
10
+ "runtime",
11
+ "period",
12
+ "series",
13
+ "data",
14
+ "chart",
15
+ "viewport",
16
+ "render",
17
+ "metadata"
18
+ ],
19
+ "properties": {
20
+ "schema": { "const": "@baron1996/time-series-scene" },
21
+ "version": { "const": 1 },
22
+ "runtime": {
23
+ "$ref": "https://baron.dev/kline-scene/time-series-runtime.schema.json"
24
+ },
25
+ "period": {
26
+ "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/period"
27
+ },
28
+ "series": {
29
+ "type": "array",
30
+ "minItems": 1,
31
+ "maxItems": 64,
32
+ "items": { "$ref": "#/$defs/timeSeriesDefinition" }
33
+ },
34
+ "data": {
35
+ "type": "array",
36
+ "minItems": 1,
37
+ "maxItems": 1000000,
38
+ "items": { "$ref": "#/$defs/timeSeriesPoint" }
39
+ },
40
+ "chart": {
41
+ "$ref": "https://baron.dev/kline-scene/time-series-chart-config.schema.json"
42
+ },
43
+ "viewport": { "$ref": "#/$defs/timeSeriesViewport" },
44
+ "render": { "$ref": "#/$defs/timeSeriesRender" },
45
+ "metadata": { "$ref": "#/$defs/metadata" }
46
+ },
47
+ "$defs": {
48
+ "timeSeriesDefinition": {
49
+ "type": "object",
50
+ "additionalProperties": false,
51
+ "required": ["id", "name", "type", "unit", "precision", "visible", "style"],
52
+ "properties": {
53
+ "id": {
54
+ "type": "string",
55
+ "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
56
+ },
57
+ "name": { "type": "string", "minLength": 1, "maxLength": 256 },
58
+ "type": { "const": "line" },
59
+ "unit": { "type": "string", "minLength": 1, "maxLength": 64 },
60
+ "precision": { "type": "integer", "minimum": 0, "maximum": 16 },
61
+ "visible": { "type": "boolean" },
62
+ "style": {
63
+ "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/lineStyle"
64
+ }
65
+ }
66
+ },
67
+ "timeSeriesPoint": {
68
+ "type": "object",
69
+ "additionalProperties": false,
70
+ "required": ["timestamp", "values"],
71
+ "properties": {
72
+ "timestamp": {
73
+ "type": "integer",
74
+ "minimum": 1,
75
+ "maximum": 9007199254740991
76
+ },
77
+ "values": {
78
+ "type": "object",
79
+ "minProperties": 1,
80
+ "maxProperties": 64,
81
+ "propertyNames": { "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$" },
82
+ "additionalProperties": {
83
+ "oneOf": [
84
+ {
85
+ "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/finiteNumber"
86
+ },
87
+ { "type": "null" }
88
+ ]
89
+ }
90
+ }
91
+ }
92
+ },
93
+ "timeSeriesViewport": {
94
+ "type": "object",
95
+ "additionalProperties": false,
96
+ "required": ["barSpace", "rightOffsetDistance", "anchorTimestamp"],
97
+ "properties": {
98
+ "barSpace": { "type": "number", "minimum": 1, "maximum": 100 },
99
+ "rightOffsetDistance": { "type": "number", "minimum": 0, "maximum": 10000 },
100
+ "anchorTimestamp": {
101
+ "type": "integer",
102
+ "minimum": 1,
103
+ "maximum": 9007199254740991
104
+ }
105
+ }
106
+ },
107
+ "timeSeriesRender": {
108
+ "type": "object",
109
+ "additionalProperties": false,
110
+ "required": [
111
+ "width",
112
+ "height",
113
+ "deviceScaleFactor",
114
+ "background",
115
+ "fontFamily",
116
+ "timeoutMs"
117
+ ],
118
+ "properties": {
119
+ "width": { "type": "integer", "minimum": 320, "maximum": 8192 },
120
+ "height": { "type": "integer", "minimum": 240, "maximum": 8192 },
121
+ "deviceScaleFactor": { "type": "number", "minimum": 0.5, "maximum": 4 },
122
+ "background": {
123
+ "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/rgbaColor"
124
+ },
125
+ "fontFamily": { "const": "Baron Sans" },
126
+ "timeoutMs": { "type": "integer", "minimum": 100, "maximum": 120000 }
127
+ }
128
+ },
129
+ "metadata": {
130
+ "type": "object",
131
+ "maxProperties": 64,
132
+ "propertyNames": { "type": "string", "minLength": 1, "maxLength": 128 },
133
+ "additionalProperties": {
134
+ "oneOf": [
135
+ { "type": "null" },
136
+ { "type": "boolean" },
137
+ {
138
+ "$ref": "https://baron.dev/kline-scene/common.schema.json#/$defs/finiteNumber"
139
+ },
140
+ { "type": "string" }
141
+ ]
142
+ }
143
+ }
144
+ }
145
+ }