lightview 1.8.1-b → 2.0.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 (224) hide show
  1. package/.agent/workflows/daisyui-component-migration.md +155 -0
  2. package/.codacy/cli.sh +149 -0
  3. package/.codacy/codacy.yaml +15 -0
  4. package/.github/instructions/codacy.instructions.md +72 -0
  5. package/.wranglerignore +21 -0
  6. package/README.md +1331 -21
  7. package/_headers +4 -0
  8. package/build.js +70 -0
  9. package/components/actions/button.js +151 -0
  10. package/components/actions/dropdown.js +120 -0
  11. package/components/actions/modal.js +146 -0
  12. package/components/actions/swap.js +118 -0
  13. package/components/daisyui.js +288 -0
  14. package/components/data-display/accordion.js +128 -0
  15. package/components/data-display/alert.js +112 -0
  16. package/components/data-display/avatar.js +170 -0
  17. package/components/data-display/badge.js +82 -0
  18. package/components/data-display/card.js +151 -0
  19. package/components/data-display/carousel.js +94 -0
  20. package/components/data-display/chart.js +220 -0
  21. package/components/data-display/chat.js +128 -0
  22. package/components/data-display/collapse.js +103 -0
  23. package/components/data-display/countdown.js +69 -0
  24. package/components/data-display/diff.js +111 -0
  25. package/components/data-display/kbd.js +65 -0
  26. package/components/data-display/loading.js +75 -0
  27. package/components/data-display/progress.js +79 -0
  28. package/components/data-display/radial-progress.js +88 -0
  29. package/components/data-display/skeleton.js +66 -0
  30. package/components/data-display/stats.js +159 -0
  31. package/components/data-display/table.js +146 -0
  32. package/components/data-display/timeline.js +146 -0
  33. package/components/data-display/toast.js +72 -0
  34. package/components/data-display/tooltip.js +74 -0
  35. package/components/data-input/checkbox.js +253 -0
  36. package/components/data-input/file-input.js +224 -0
  37. package/components/data-input/input.js +264 -0
  38. package/components/data-input/radio.js +338 -0
  39. package/components/data-input/range.js +204 -0
  40. package/components/data-input/rating.js +219 -0
  41. package/components/data-input/select.js +287 -0
  42. package/components/data-input/textarea.js +287 -0
  43. package/components/data-input/toggle.js +201 -0
  44. package/components/index.js +137 -0
  45. package/components/layout/divider.js +72 -0
  46. package/components/layout/drawer.js +142 -0
  47. package/components/layout/footer.js +100 -0
  48. package/components/layout/hero.js +109 -0
  49. package/components/layout/indicator.js +90 -0
  50. package/components/layout/join.js +78 -0
  51. package/components/layout/navbar.js +110 -0
  52. package/components/navigation/breadcrumbs.js +91 -0
  53. package/components/navigation/dock.js +103 -0
  54. package/components/navigation/menu.js +126 -0
  55. package/components/navigation/pagination.js +105 -0
  56. package/components/navigation/steps.js +89 -0
  57. package/components/navigation/tabs.css +177 -0
  58. package/components/navigation/tabs.js +123 -0
  59. package/components/theme/theme-switch.css +65 -0
  60. package/components/theme/theme-switch.js +177 -0
  61. package/docs/about.html +164 -0
  62. package/docs/api/computed.html +184 -0
  63. package/docs/api/effects.html +173 -0
  64. package/docs/api/elements.html +180 -0
  65. package/docs/api/enhance.html +225 -0
  66. package/docs/api/hypermedia.html +165 -0
  67. package/docs/api/index.html +178 -0
  68. package/docs/api/nav.html +18 -0
  69. package/docs/api/signals.html +136 -0
  70. package/docs/api/state.html +217 -0
  71. package/docs/assets/images/logo-favicon.svg +42 -0
  72. package/docs/assets/images/logo-static.svg +40 -0
  73. package/docs/assets/images/logo.svg +66 -0
  74. package/docs/assets/js/examplify.js +395 -0
  75. package/docs/assets/styles/site.css +1102 -0
  76. package/docs/assets/styles/themes.css +236 -0
  77. package/docs/components/accordion.html +439 -0
  78. package/docs/components/alert.html +528 -0
  79. package/docs/components/avatar.html +586 -0
  80. package/docs/components/badge.html +531 -0
  81. package/docs/components/breadcrumbs.html +278 -0
  82. package/docs/components/button.html +579 -0
  83. package/docs/components/card.html +561 -0
  84. package/docs/components/carousel.html +286 -0
  85. package/docs/components/chart-area.html +702 -0
  86. package/docs/components/chart-bar.html +782 -0
  87. package/docs/components/chart-column.html +735 -0
  88. package/docs/components/chart-line.html +794 -0
  89. package/docs/components/chart-pie.html +823 -0
  90. package/docs/components/chart.html +612 -0
  91. package/docs/components/chat.html +547 -0
  92. package/docs/components/checkbox.html +641 -0
  93. package/docs/components/collapse.html +536 -0
  94. package/docs/components/component-nav.html +53 -0
  95. package/docs/components/countdown.html +470 -0
  96. package/docs/components/diff.html +245 -0
  97. package/docs/components/divider.html +240 -0
  98. package/docs/components/dock.html +277 -0
  99. package/docs/components/drawer.html +515 -0
  100. package/docs/components/dropdown.html +479 -0
  101. package/docs/components/file-input.html +591 -0
  102. package/docs/components/footer.html +301 -0
  103. package/docs/components/gallery.html +504 -0
  104. package/docs/components/hero.html +264 -0
  105. package/docs/components/index.css +840 -0
  106. package/docs/components/index.html +735 -0
  107. package/docs/components/indicator.html +342 -0
  108. package/docs/components/input.html +644 -0
  109. package/docs/components/join.html +285 -0
  110. package/docs/components/kbd.html +322 -0
  111. package/docs/components/loading.html +521 -0
  112. package/docs/components/menu.html +461 -0
  113. package/docs/components/modal.html +639 -0
  114. package/docs/components/navbar.html +321 -0
  115. package/docs/components/pagination.html +279 -0
  116. package/docs/components/progress.html +514 -0
  117. package/docs/components/radial-progress.html +434 -0
  118. package/docs/components/radio.html +655 -0
  119. package/docs/components/range.html +611 -0
  120. package/docs/components/rating.html +642 -0
  121. package/docs/components/select.html +696 -0
  122. package/docs/components/sidebar-setup.js +93 -0
  123. package/docs/components/skeleton.html +447 -0
  124. package/docs/components/spinner.html +68 -0
  125. package/docs/components/stats.html +486 -0
  126. package/docs/components/steps.html +356 -0
  127. package/docs/components/swap.html +517 -0
  128. package/docs/components/switch.html +68 -0
  129. package/docs/components/table.html +668 -0
  130. package/docs/components/tabs.html +506 -0
  131. package/docs/components/text-input.html +68 -0
  132. package/docs/components/textarea.html +603 -0
  133. package/docs/components/timeline.html +487 -0
  134. package/docs/components/toast.html +474 -0
  135. package/docs/components/toggle.html +564 -0
  136. package/docs/components/tooltip.html +423 -0
  137. package/docs/examples/getting-started-example.html +40 -0
  138. package/docs/examples/index.html +93 -0
  139. package/docs/getting-started/index.html +739 -0
  140. package/docs/getting-started/reviews.html +23 -0
  141. package/docs/getting-started/reviews.odom +108 -0
  142. package/docs/getting-started/reviews.vdom +84 -0
  143. package/docs/index.html +134 -0
  144. package/docs/playground.html +416 -0
  145. package/docs/router.html +285 -0
  146. package/docs/styles/index.html +190 -0
  147. package/functions/_middleware.js +32 -0
  148. package/index.html +309 -0
  149. package/lightview-router.js +364 -0
  150. package/lightview-x.js +1577 -0
  151. package/lightview.js +658 -1109
  152. package/lightview.js.backup +793 -0
  153. package/middleware/locale.js +25 -0
  154. package/middleware/markdown.js +44 -0
  155. package/middleware/notFound.js +37 -0
  156. package/package.json +27 -41
  157. package/watch.js +92 -0
  158. package/wrangler.toml +12 -0
  159. package/.idea/lightview.iml +0 -12
  160. package/.idea/modules.xml +0 -8
  161. package/.idea/vcs.xml +0 -6
  162. package/LICENSE +0 -21
  163. package/codepen-no-tabs-embed.css +0 -2
  164. package/components/chart/chart.html +0 -17
  165. package/components/chart/example.html +0 -32
  166. package/components/chart.html +0 -83
  167. package/components/components.js +0 -113
  168. package/components/gantt/example.html +0 -22
  169. package/components/gantt/gantt.html +0 -42
  170. package/components/gauge/example.html +0 -28
  171. package/components/gauge/gauge.html +0 -20
  172. package/components/gauge.html +0 -60
  173. package/components/orgchart/example.html +0 -25
  174. package/components/orgchart/orgchart.html +0 -41
  175. package/components/repl/code-editor.html +0 -64
  176. package/components/repl/editor.html +0 -37
  177. package/components/repl/editorjs-inline-tool/index.js +0 -3
  178. package/components/repl/editorjs-inline-tool/inline-tools.js +0 -28
  179. package/components/repl/editorjs-inline-tool/tool.js +0 -175
  180. package/components/repl/repl-with-wysiwyg.html +0 -355
  181. package/components/repl/repl.html +0 -345
  182. package/components/repl/sup.js +0 -44
  183. package/components/repl/wysiwyg-repl.html +0 -258
  184. package/components/timeline/example.html +0 -33
  185. package/components/timeline/timeline.html +0 -44
  186. package/components/timeline.html +0 -81
  187. package/examples/anchor.html +0 -11
  188. package/examples/chart.html +0 -34
  189. package/examples/counter.html +0 -26
  190. package/examples/counter.test.mjs +0 -47
  191. package/examples/counter2.html +0 -26
  192. package/examples/directives.html +0 -79
  193. package/examples/foreign.html +0 -50
  194. package/examples/forgeinform.html +0 -98
  195. package/examples/form.html +0 -61
  196. package/examples/gauge.html +0 -18
  197. package/examples/invalid-template-literals.html +0 -44
  198. package/examples/medium/remote.html +0 -60
  199. package/examples/message.html +0 -18
  200. package/examples/nested.html +0 -11
  201. package/examples/object-bound-form.html +0 -34
  202. package/examples/remote-server.js +0 -51
  203. package/examples/remote.html +0 -34
  204. package/examples/remote.json +0 -1
  205. package/examples/scratch.html +0 -69
  206. package/examples/sensors/index.html +0 -30
  207. package/examples/sensors/sensor-server.js +0 -30
  208. package/examples/shared.html +0 -41
  209. package/examples/template.html +0 -33
  210. package/examples/timeline.html +0 -21
  211. package/examples/todo.html +0 -38
  212. package/examples/top.html +0 -10
  213. package/examples/types.html +0 -94
  214. package/examples/xor.html +0 -62
  215. package/jest-puppeteer.config.js +0 -5
  216. package/jest.config.json +0 -12
  217. package/sites/client.html +0 -48
  218. package/sites/index.html +0 -247
  219. package/test/basic.html +0 -93
  220. package/test/basic.test.mjs +0 -315
  221. package/test/extended.html +0 -29
  222. package/test/extended.test.mjs +0 -448
  223. package/types.js +0 -534
  224. package/unsplash.key +0 -1
@@ -0,0 +1,794 @@
1
+ <!-- SEO-friendly SPA Shim -->
2
+ <script src="/lightview-router.js"></script>
3
+ <script>
4
+ if (window.LightviewRouter) {
5
+ LightviewRouter.base('/index.html');
6
+ }
7
+ </script>
8
+ <script type="module" src="../../components/data-display/chart.js"></script>
9
+
10
+ <!-- Load the page-specific stylesheet -->
11
+ <link rel="stylesheet" href="./index.css">
12
+
13
+ <!-- Gallery Structure -->
14
+ <div class="gallery-page">
15
+ <div class="gallery-layout">
16
+ <!-- Sidebar Overlay -->
17
+ <div id="sidebar-overlay" class="sidebar-overlay"></div>
18
+
19
+ <!-- Sidebar -->
20
+ <div id="gallery-sidebar" class="gallery-sidebar" style="visibility: hidden" src="./component-nav.html"></div>
21
+
22
+ <!-- Main Content -->
23
+ <div id="gallery-main" class="gallery-main">
24
+ <!-- Header Container -->
25
+ <div
26
+ style="position: sticky; top: 0; z-index: 30; background: var(--gallery-surface); border-bottom: 1px solid var(--gallery-border); backdrop-filter: blur(8px);">
27
+ <!-- Breadcrumbs Row -->
28
+ <div style="padding: 0.75rem 1.5rem 0;">
29
+ <script>
30
+ (() => {
31
+ const { Breadcrumbs } = Lightview.tags;
32
+ const breadcrumbs = Breadcrumbs({
33
+ id: 'page-breadcrumbs',
34
+ items: [
35
+ { label: 'Components', href: '/docs/components' },
36
+ { label: 'Chart Line' }
37
+ ]
38
+ });
39
+ document.currentScript.replaceWith(breadcrumbs.domEl);
40
+ })();
41
+ </script>
42
+ </div>
43
+ <!-- Title Row -->
44
+ <div class="gallery-header"
45
+ style="border-bottom: none; height: auto; padding-top: 0.5rem; padding-bottom: 0.75rem;">
46
+ <button id="toggle-btn" class="toggle-btn" aria-label="Toggle Sidebar">
47
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="toggle-icon"
48
+ style="stroke: currentColor; stroke-width: 2;">
49
+ <path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7" />
50
+ <path stroke-linecap="round" stroke-linejoin="round" d="M11 19l-7-7 7-7" />
51
+ </svg>
52
+ </button>
53
+ <h1 class="gallery-title">Chart Line</h1>
54
+ </div>
55
+ </div>
56
+
57
+ <!-- Content -->
58
+ <div class="gallery-content">
59
+ <div class="section-content" style="max-width: 1000px;">
60
+ <p class="text-lg" style="opacity: 0.7; margin-bottom: 1.5rem;">
61
+ Line charts display data as points connected by lines, ideal for showing trends over time.
62
+ </p>
63
+
64
+ <!-- Basic Usage -->
65
+ <div class="card bg-base-200" style="margin-bottom: 2rem;">
66
+ <div class="card-body">
67
+ <h2 class="card-title">Basic Usage</h2>
68
+ <p class="text-sm" style="opacity: 0.7; margin-bottom: 1rem;">
69
+ To visualize data with a line chart, use <code>type: 'line'</code>. Line charts require
70
+ both <code>start</code> and <code>value</code> (displayed as <code>--size</code>).
71
+ </p>
72
+
73
+ <!-- Tabs -->
74
+ <script>
75
+ window.switchBasicLineTab = (tabId) => {
76
+ const tabs = ['tagged', 'vdom', 'object'];
77
+ tabs.forEach(t => {
78
+ const tabEl = document.getElementById(`basic-line-tab-btn-${t}`);
79
+ const contentEl = document.getElementById(`basic-line-syntax-${t}`);
80
+ if (t === tabId) {
81
+ tabEl.classList.add('syntax-tab-active');
82
+ contentEl.style.display = 'block';
83
+ } else {
84
+ tabEl.classList.remove('syntax-tab-active');
85
+ contentEl.style.display = 'none';
86
+ }
87
+ });
88
+ };
89
+ </script>
90
+ <div role="tablist" class="syntax-tabs" style="margin-bottom: 1rem;">
91
+ <button id="basic-line-tab-btn-tagged" role="tab" class="syntax-tab syntax-tab-active"
92
+ onclick="switchBasicLineTab('tagged')">Tagged</button>
93
+ <button id="basic-line-tab-btn-vdom" role="tab" class="syntax-tab"
94
+ onclick="switchBasicLineTab('vdom')">vDOM</button>
95
+ <button id="basic-line-tab-btn-object" role="tab" class="syntax-tab"
96
+ onclick="switchBasicLineTab('object')">Object DOM</button>
97
+ </div>
98
+
99
+ <!-- Tagged Syntax -->
100
+ <div id="basic-line-syntax-tagged">
101
+ <pre><script>
102
+ examplify(document.currentScript.nextElementSibling, {
103
+ at: document.currentScript.parentElement,
104
+ scripts: ['/lightview.js', '/lightview-x.js'],
105
+ styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
106
+ type: 'module',
107
+ minHeight: 250,
108
+ autoRun: true
109
+ });
110
+ </script><code contenteditable="true">await import('/components/data-display/chart.js');
111
+ const { tags, $ } = Lightview;
112
+ const { Chart, span } = tags;
113
+
114
+ const chart = Chart({
115
+ type: 'line',
116
+ labels: true,
117
+ primaryAxis: true,
118
+ style: 'width: 100%; max-width: 600px; height: 250px; margin: 0 auto;'
119
+ },
120
+ Chart.Body({},
121
+ Chart.Row({},
122
+ Chart.Label({}, 'Jan'),
123
+ Chart.Data({ start: 0.2, value: 0.4 }, span({ class: 'data' }, '40%'))
124
+ ),
125
+ Chart.Row({},
126
+ Chart.Label({}, 'Feb'),
127
+ Chart.Data({ start: 0.4, value: 0.6 }, span({ class: 'data' }, '60%'))
128
+ ),
129
+ Chart.Row({},
130
+ Chart.Label({}, 'Mar'),
131
+ Chart.Data({ start: 0.6, value: 0.5 }, span({ class: 'data' }, '50%'))
132
+ ),
133
+ Chart.Row({},
134
+ Chart.Label({}, 'Apr'),
135
+ Chart.Data({ start: 0.5, value: 0.8 }, span({ class: 'data' }, '80%'))
136
+ ),
137
+ Chart.Row({},
138
+ Chart.Label({}, 'May'),
139
+ Chart.Data({ start: 0.8, value: 0.7 }, span({ class: 'data' }, '70%'))
140
+ )
141
+ )
142
+ );
143
+
144
+ $('#example').content(chart);</code></pre>
145
+ </div>
146
+
147
+ <!-- vDOM Syntax -->
148
+ <div id="basic-line-syntax-vdom" style="display: none;">
149
+ <pre><script>
150
+ examplify(document.currentScript.nextElementSibling, {
151
+ at: document.currentScript.parentElement,
152
+ scripts: ['/lightview.js', '/lightview-x.js'],
153
+ styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
154
+ type: 'module',
155
+ minHeight: 250
156
+ });
157
+ </script><code contenteditable="true">await import('/components/data-display/chart.js');
158
+ const { tags, $ } = Lightview;
159
+ const { Chart, span } = tags;
160
+
161
+ const months = [
162
+ { label: 'Jan', start: 0.2, value: 0.4, text: '40%' },
163
+ { label: 'Feb', start: 0.4, value: 0.6, text: '60%' },
164
+ { label: 'Mar', start: 0.6, value: 0.5, text: '50%' },
165
+ { label: 'Apr', start: 0.5, value: 0.8, text: '80%' },
166
+ { label: 'May', start: 0.8, value: 0.7, text: '70%' }
167
+ ];
168
+
169
+ const chart = {
170
+ tag: Chart,
171
+ attributes: {
172
+ type: 'line',
173
+ labels: true,
174
+ primaryAxis: true,
175
+ style: 'width: 100%; max-width: 600px; height: 250px; margin: 0 auto;'
176
+ },
177
+ children: [
178
+ {
179
+ tag: Chart.Body,
180
+ children: months.map(m => ({
181
+ tag: Chart.Row,
182
+ children: [
183
+ { tag: Chart.Label, children: [m.label] },
184
+ {
185
+ tag: Chart.Data,
186
+ attributes: { start: m.start, value: m.value },
187
+ children: [{ tag: span, attributes: { class: 'data' }, children: [m.text] }]
188
+ }
189
+ ]
190
+ }))
191
+ }
192
+ ]
193
+ };
194
+
195
+ $('#example').content(chart);</code></pre>
196
+ </div>
197
+
198
+ <!-- Object DOM Syntax -->
199
+ <div id="basic-line-syntax-object" style="display: none;">
200
+ <pre><script>
201
+ examplify(document.currentScript.nextElementSibling, {
202
+ at: document.currentScript.parentElement,
203
+ scripts: ['/lightview.js', '/lightview-x.js'],
204
+ styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
205
+ type: 'module',
206
+ minHeight: 250
207
+ });
208
+ </script><code contenteditable="true">await import('/components/data-display/chart.js');
209
+ const { $ } = Lightview;
210
+
211
+ const chart = {
212
+ Chart: {
213
+ type: 'line',
214
+ labels: true,
215
+ primaryAxis: true,
216
+ style: 'width: 100%; max-width: 600px; height: 250px; margin: 0 auto;',
217
+ children: [
218
+ {
219
+ 'Chart.Body': {
220
+ children: [
221
+ {
222
+ 'Chart.Row': {
223
+ children: [
224
+ { 'Chart.Label': { children: ['Jan'] } },
225
+ { 'Chart.Data': { start: 0.2, value: 0.4, children: [{ span: { class: 'data', children: ['40%'] } }] } }
226
+ ]
227
+ }
228
+ },
229
+ {
230
+ 'Chart.Row': {
231
+ children: [
232
+ { 'Chart.Label': { children: ['Feb'] } },
233
+ { 'Chart.Data': { start: 0.4, value: 0.6, children: [{ span: { class: 'data', children: ['60%'] } }] } }
234
+ ]
235
+ }
236
+ },
237
+ {
238
+ 'Chart.Row': {
239
+ children: [
240
+ { 'Chart.Label': { children: ['Mar'] } },
241
+ { 'Chart.Data': { start: 0.6, value: 0.5, children: [{ span: { class: 'data', children: ['50%'] } }] } }
242
+ ]
243
+ }
244
+ },
245
+ {
246
+ 'Chart.Row': {
247
+ children: [
248
+ { 'Chart.Label': { children: ['Apr'] } },
249
+ { 'Chart.Data': { start: 0.5, value: 0.8, children: [{ span: { class: 'data', children: ['80%'] } }] } }
250
+ ]
251
+ }
252
+ },
253
+ {
254
+ 'Chart.Row': {
255
+ children: [
256
+ { 'Chart.Label': { children: ['May'] } },
257
+ { 'Chart.Data': { start: 0.8, value: 0.7, children: [{ span: { class: 'data', children: ['70%'] } }] } }
258
+ ]
259
+ }
260
+ }
261
+ ]
262
+ }
263
+ }
264
+ ]
265
+ }
266
+ };
267
+
268
+ $('#example').content(chart);</code></pre>
269
+ </div>
270
+ </div>
271
+ </div>
272
+
273
+ <!-- Multiple Datasets -->
274
+ <div class="card bg-base-200" style="margin-bottom: 2rem;">
275
+ <div class="card-body">
276
+ <h2 class="card-title">Multiple Datasets</h2>
277
+ <p class="text-sm" style="opacity: 0.7; margin-bottom: 1rem;">
278
+ Add multiple lines by using multiple <code>Chart.Data</code> elements with
279
+ <code>multiple: true</code>.
280
+ </p>
281
+
282
+ <!-- Tabs -->
283
+ <script>
284
+ window.switchMultipleLineTab = (tabId) => {
285
+ const tabs = ['tagged', 'vdom', 'object'];
286
+ tabs.forEach(t => {
287
+ const tabEl = document.getElementById(`multiple-line-tab-btn-${t}`);
288
+ const contentEl = document.getElementById(`multiple-line-syntax-${t}`);
289
+ if (t === tabId) {
290
+ tabEl.classList.add('syntax-tab-active');
291
+ contentEl.style.display = 'block';
292
+ } else {
293
+ tabEl.classList.remove('syntax-tab-active');
294
+ contentEl.style.display = 'none';
295
+ }
296
+ });
297
+ };
298
+ </script>
299
+ <div role="tablist" class="syntax-tabs" style="margin-bottom: 1rem;">
300
+ <button id="multiple-line-tab-btn-tagged" role="tab"
301
+ class="syntax-tab syntax-tab-active"
302
+ onclick="switchMultipleLineTab('tagged')">Tagged</button>
303
+ <button id="multiple-line-tab-btn-vdom" role="tab" class="syntax-tab"
304
+ onclick="switchMultipleLineTab('vdom')">vDOM</button>
305
+ <button id="multiple-line-tab-btn-object" role="tab" class="syntax-tab"
306
+ onclick="switchMultipleLineTab('object')">Object DOM</button>
307
+ </div>
308
+
309
+ <!-- Tagged Syntax -->
310
+ <div id="multiple-line-syntax-tagged">
311
+ <pre><script>
312
+ examplify(document.currentScript.nextElementSibling, {
313
+ at: document.currentScript.parentElement,
314
+ scripts: ['/lightview.js', '/lightview-x.js'],
315
+ styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
316
+ type: 'module',
317
+ minHeight: 280,
318
+ autoRun: true
319
+ });
320
+ </script><code contenteditable="true">await import('/components/data-display/chart.js');
321
+ const { tags, $ } = Lightview;
322
+ const { Chart } = tags;
323
+
324
+ const chart = Chart({
325
+ type: 'line',
326
+ multiple: true,
327
+ labels: true,
328
+ primaryAxis: true,
329
+ style: 'width: 100%; max-width: 600px; height: 280px; margin: 0 auto; --color-1: #4CAF50; --color-2: #2196F3; --color-3: #FF9800;'
330
+ },
331
+ Chart.Body({},
332
+ Chart.Row({},
333
+ Chart.Label({}, 'Q1'),
334
+ Chart.Data({ start: 0.2, value: 0.4 }),
335
+ Chart.Data({ start: 0.3, value: 0.5 }),
336
+ Chart.Data({ start: 0.1, value: 0.3 })
337
+ ),
338
+ Chart.Row({},
339
+ Chart.Label({}, 'Q2'),
340
+ Chart.Data({ start: 0.4, value: 0.5 }),
341
+ Chart.Data({ start: 0.5, value: 0.6 }),
342
+ Chart.Data({ start: 0.3, value: 0.5 })
343
+ ),
344
+ Chart.Row({},
345
+ Chart.Label({}, 'Q3'),
346
+ Chart.Data({ start: 0.5, value: 0.7 }),
347
+ Chart.Data({ start: 0.6, value: 0.4 }),
348
+ Chart.Data({ start: 0.5, value: 0.6 })
349
+ ),
350
+ Chart.Row({},
351
+ Chart.Label({}, 'Q4'),
352
+ Chart.Data({ start: 0.7, value: 0.9 }),
353
+ Chart.Data({ start: 0.4, value: 0.7 }),
354
+ Chart.Data({ start: 0.6, value: 0.8 })
355
+ )
356
+ )
357
+ );
358
+
359
+ $('#example').content(chart);</code></pre>
360
+ </div>
361
+
362
+ <!-- vDOM Syntax -->
363
+ <div id="multiple-line-syntax-vdom" style="display: none;">
364
+ <pre><script>
365
+ examplify(document.currentScript.nextElementSibling, {
366
+ at: document.currentScript.parentElement,
367
+ scripts: ['/lightview.js', '/lightview-x.js'],
368
+ styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
369
+ type: 'module',
370
+ minHeight: 280
371
+ });
372
+ </script><code contenteditable="true">await import('/components/data-display/chart.js');
373
+ const { tags, $ } = Lightview;
374
+ const { Chart } = tags;
375
+
376
+ const quarters = [
377
+ { label: 'Q1', data: [[0.2, 0.4], [0.3, 0.5], [0.1, 0.3]] },
378
+ { label: 'Q2', data: [[0.4, 0.5], [0.5, 0.6], [0.3, 0.5]] },
379
+ { label: 'Q3', data: [[0.5, 0.7], [0.6, 0.4], [0.5, 0.6]] },
380
+ { label: 'Q4', data: [[0.7, 0.9], [0.4, 0.7], [0.6, 0.8]] }
381
+ ];
382
+
383
+ const chart = {
384
+ tag: Chart,
385
+ attributes: {
386
+ type: 'line',
387
+ multiple: true,
388
+ labels: true,
389
+ primaryAxis: true,
390
+ style: 'width: 100%; max-width: 600px; height: 280px; margin: 0 auto; --color-1: #4CAF50; --color-2: #2196F3; --color-3: #FF9800;'
391
+ },
392
+ children: [
393
+ {
394
+ tag: Chart.Body,
395
+ children: quarters.map(q => ({
396
+ tag: Chart.Row,
397
+ children: [
398
+ { tag: Chart.Label, children: [q.label] },
399
+ ...q.data.map(([start, value]) => ({
400
+ tag: Chart.Data,
401
+ attributes: { start, value }
402
+ }))
403
+ ]
404
+ }))
405
+ }
406
+ ]
407
+ };
408
+
409
+ $('#example').content(chart);</code></pre>
410
+ </div>
411
+
412
+ <!-- Object DOM Syntax -->
413
+ <div id="multiple-line-syntax-object" style="display: none;">
414
+ <pre><script>
415
+ examplify(document.currentScript.nextElementSibling, {
416
+ at: document.currentScript.parentElement,
417
+ scripts: ['/lightview.js', '/lightview-x.js'],
418
+ styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
419
+ type: 'module',
420
+ minHeight: 280
421
+ });
422
+ </script><code contenteditable="true">await import('/components/data-display/chart.js');
423
+ const { $ } = Lightview;
424
+
425
+ const chart = {
426
+ Chart: {
427
+ type: 'line',
428
+ multiple: true,
429
+ labels: true,
430
+ primaryAxis: true,
431
+ style: 'width: 100%; max-width: 600px; height: 280px; margin: 0 auto; --color-1: #4CAF50; --color-2: #2196F3; --color-3: #FF9800;',
432
+ children: [
433
+ {
434
+ 'Chart.Body': {
435
+ children: [
436
+ {
437
+ 'Chart.Row': {
438
+ children: [
439
+ { 'Chart.Label': { children: ['Q1'] } },
440
+ { 'Chart.Data': { start: 0.2, value: 0.4 } },
441
+ { 'Chart.Data': { start: 0.3, value: 0.5 } },
442
+ { 'Chart.Data': { start: 0.1, value: 0.3 } }
443
+ ]
444
+ }
445
+ },
446
+ {
447
+ 'Chart.Row': {
448
+ children: [
449
+ { 'Chart.Label': { children: ['Q2'] } },
450
+ { 'Chart.Data': { start: 0.4, value: 0.5 } },
451
+ { 'Chart.Data': { start: 0.5, value: 0.6 } },
452
+ { 'Chart.Data': { start: 0.3, value: 0.5 } }
453
+ ]
454
+ }
455
+ },
456
+ {
457
+ 'Chart.Row': {
458
+ children: [
459
+ { 'Chart.Label': { children: ['Q3'] } },
460
+ { 'Chart.Data': { start: 0.5, value: 0.7 } },
461
+ { 'Chart.Data': { start: 0.6, value: 0.4 } },
462
+ { 'Chart.Data': { start: 0.5, value: 0.6 } }
463
+ ]
464
+ }
465
+ },
466
+ {
467
+ 'Chart.Row': {
468
+ children: [
469
+ { 'Chart.Label': { children: ['Q4'] } },
470
+ { 'Chart.Data': { start: 0.7, value: 0.9 } },
471
+ { 'Chart.Data': { start: 0.4, value: 0.7 } },
472
+ { 'Chart.Data': { start: 0.6, value: 0.8 } }
473
+ ]
474
+ }
475
+ }
476
+ ]
477
+ }
478
+ }
479
+ ]
480
+ }
481
+ };
482
+
483
+ $('#example').content(chart);</code></pre>
484
+ </div>
485
+ </div>
486
+ </div>
487
+
488
+ <!-- Axes and Grid -->
489
+ <div class="card bg-base-200" style="margin-bottom: 2rem;">
490
+ <div class="card-body">
491
+ <h2 class="card-title">Axes and Grid</h2>
492
+ <p class="text-sm" style="opacity: 0.7; margin-bottom: 1rem;">
493
+ Add grid lines with <code>secondaryAxis</code>.
494
+ </p>
495
+
496
+ <!-- Tabs -->
497
+ <script>
498
+ window.switchAxesLineTab = (tabId) => {
499
+ const tabs = ['tagged', 'vdom', 'object'];
500
+ tabs.forEach(t => {
501
+ const tabEl = document.getElementById(`axes-line-tab-btn-${t}`);
502
+ const contentEl = document.getElementById(`axes-line-syntax-${t}`);
503
+ if (t === tabId) {
504
+ tabEl.classList.add('syntax-tab-active');
505
+ contentEl.style.display = 'block';
506
+ } else {
507
+ tabEl.classList.remove('syntax-tab-active');
508
+ contentEl.style.display = 'none';
509
+ }
510
+ });
511
+ };
512
+ </script>
513
+ <div role="tablist" class="syntax-tabs" style="margin-bottom: 1rem;">
514
+ <button id="axes-line-tab-btn-tagged" role="tab" class="syntax-tab syntax-tab-active"
515
+ onclick="switchAxesLineTab('tagged')">Tagged</button>
516
+ <button id="axes-line-tab-btn-vdom" role="tab" class="syntax-tab"
517
+ onclick="switchAxesLineTab('vdom')">vDOM</button>
518
+ <button id="axes-line-tab-btn-object" role="tab" class="syntax-tab"
519
+ onclick="switchAxesLineTab('object')">Object DOM</button>
520
+ </div>
521
+
522
+ <!-- Tagged Syntax -->
523
+ <div id="axes-line-syntax-tagged">
524
+ <pre><script>
525
+ examplify(document.currentScript.nextElementSibling, {
526
+ at: document.currentScript.parentElement,
527
+ scripts: ['/lightview.js', '/lightview-x.js'],
528
+ styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
529
+ type: 'module',
530
+ minHeight: 280,
531
+ autoRun: true
532
+ });
533
+ </script><code contenteditable="true">await import('/components/data-display/chart.js');
534
+ const { tags, $ } = Lightview;
535
+ const { Chart } = tags;
536
+
537
+ const chart = Chart({
538
+ type: 'line',
539
+ labels: true,
540
+ primaryAxis: true,
541
+ secondaryAxis: 'show-10-secondary-axes',
542
+ style: 'width: 100%; max-width: 600px; height: 280px; margin: 0 auto;'
543
+ },
544
+ Chart.Body({},
545
+ Chart.Row({}, Chart.Label({}, '1'), Chart.Data({ start: 0.1, value: 0.3 })),
546
+ Chart.Row({}, Chart.Label({}, '2'), Chart.Data({ start: 0.3, value: 0.5 })),
547
+ Chart.Row({}, Chart.Label({}, '3'), Chart.Data({ start: 0.5, value: 0.4 })),
548
+ Chart.Row({}, Chart.Label({}, '4'), Chart.Data({ start: 0.4, value: 0.7 })),
549
+ Chart.Row({}, Chart.Label({}, '5'), Chart.Data({ start: 0.7, value: 0.6 })),
550
+ Chart.Row({}, Chart.Label({}, '6'), Chart.Data({ start: 0.6, value: 0.9 }))
551
+ )
552
+ );
553
+
554
+ $('#example').content(chart);</code></pre>
555
+ </div>
556
+
557
+ <!-- vDOM Syntax -->
558
+ <div id="axes-line-syntax-vdom" style="display: none;">
559
+ <pre><script>
560
+ examplify(document.currentScript.nextElementSibling, {
561
+ at: document.currentScript.parentElement,
562
+ scripts: ['/lightview.js', '/lightview-x.js'],
563
+ styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
564
+ type: 'module',
565
+ minHeight: 280
566
+ });
567
+ </script><code contenteditable="true">await import('/components/data-display/chart.js');
568
+ const { tags, $ } = Lightview;
569
+ const { Chart } = tags;
570
+
571
+ const data = [
572
+ [0.1, 0.3], [0.3, 0.5], [0.5, 0.4],
573
+ [0.4, 0.7], [0.7, 0.6], [0.6, 0.9]
574
+ ];
575
+
576
+ const chart = {
577
+ tag: Chart,
578
+ attributes: {
579
+ type: 'line',
580
+ labels: true,
581
+ primaryAxis: true,
582
+ secondaryAxis: 'show-10-secondary-axes',
583
+ style: 'width: 100%; max-width: 600px; height: 280px; margin: 0 auto;'
584
+ },
585
+ children: [
586
+ {
587
+ tag: Chart.Body,
588
+ children: data.map(([start, value], i) => ({
589
+ tag: Chart.Row,
590
+ children: [
591
+ { tag: Chart.Label, children: [String(i + 1)] },
592
+ { tag: Chart.Data, attributes: { start, value } }
593
+ ]
594
+ }))
595
+ }
596
+ ]
597
+ };
598
+
599
+ $('#example').content(chart);</code></pre>
600
+ </div>
601
+
602
+ <!-- Object DOM Syntax -->
603
+ <div id="axes-line-syntax-object" style="display: none;">
604
+ <pre><script>
605
+ examplify(document.currentScript.nextElementSibling, {
606
+ at: document.currentScript.parentElement,
607
+ scripts: ['/lightview.js', '/lightview-x.js'],
608
+ styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
609
+ type: 'module',
610
+ minHeight: 280
611
+ });
612
+ </script><code contenteditable="true">await import('/components/data-display/chart.js');
613
+ const { $ } = Lightview;
614
+
615
+ const chart = {
616
+ Chart: {
617
+ type: 'line',
618
+ labels: true,
619
+ primaryAxis: true,
620
+ secondaryAxis: 'show-10-secondary-axes',
621
+ style: 'width: 100%; max-width: 600px; height: 280px; margin: 0 auto;',
622
+ children: [
623
+ {
624
+ 'Chart.Body': {
625
+ children: [
626
+ { 'Chart.Row': { children: [{ 'Chart.Label': { children: ['1'] } }, { 'Chart.Data': { start: 0.1, value: 0.3 } }] } },
627
+ { 'Chart.Row': { children: [{ 'Chart.Label': { children: ['2'] } }, { 'Chart.Data': { start: 0.3, value: 0.5 } }] } },
628
+ { 'Chart.Row': { children: [{ 'Chart.Label': { children: ['3'] } }, { 'Chart.Data': { start: 0.5, value: 0.4 } }] } },
629
+ { 'Chart.Row': { children: [{ 'Chart.Label': { children: ['4'] } }, { 'Chart.Data': { start: 0.4, value: 0.7 } }] } },
630
+ { 'Chart.Row': { children: [{ 'Chart.Label': { children: ['5'] } }, { 'Chart.Data': { start: 0.7, value: 0.6 } }] } },
631
+ { 'Chart.Row': { children: [{ 'Chart.Label': { children: ['6'] } }, { 'Chart.Data': { start: 0.6, value: 0.9 } }] } }
632
+ ]
633
+ }
634
+ }
635
+ ]
636
+ }
637
+ };
638
+
639
+ $('#example').content(chart);</code></pre>
640
+ </div>
641
+ </div>
642
+ </div>
643
+
644
+ <!-- Line Styling -->
645
+ <div class="card bg-base-200" style="margin-bottom: 2rem;">
646
+ <div class="card-body">
647
+ <h2 class="card-title">Line Styling</h2>
648
+ <p class="text-sm" style="opacity: 0.7; margin-bottom: 1rem;">
649
+ Customize line appearance with CSS custom properties.
650
+ </p>
651
+
652
+ <!-- Tabs -->
653
+ <script>
654
+ window.switchStyledLineTab = (tabId) => {
655
+ const tabs = ['tagged', 'vdom', 'object'];
656
+ tabs.forEach(t => {
657
+ const tabEl = document.getElementById(`styled-line-tab-btn-${t}`);
658
+ const contentEl = document.getElementById(`styled-line-syntax-${t}`);
659
+ if (t === tabId) {
660
+ tabEl.classList.add('syntax-tab-active');
661
+ contentEl.style.display = 'block';
662
+ } else {
663
+ tabEl.classList.remove('syntax-tab-active');
664
+ contentEl.style.display = 'none';
665
+ }
666
+ });
667
+ };
668
+ </script>
669
+ <div role="tablist" class="syntax-tabs" style="margin-bottom: 1rem;">
670
+ <button id="styled-line-tab-btn-tagged" role="tab" class="syntax-tab syntax-tab-active"
671
+ onclick="switchStyledLineTab('tagged')">Tagged</button>
672
+ <button id="styled-line-tab-btn-vdom" role="tab" class="syntax-tab"
673
+ onclick="switchStyledLineTab('vdom')">vDOM</button>
674
+ <button id="styled-line-tab-btn-object" role="tab" class="syntax-tab"
675
+ onclick="switchStyledLineTab('object')">Object DOM</button>
676
+ </div>
677
+
678
+ <!-- Tagged Syntax -->
679
+ <div id="styled-line-syntax-tagged">
680
+ <pre><script>
681
+ examplify(document.currentScript.nextElementSibling, {
682
+ at: document.currentScript.parentElement,
683
+ scripts: ['/lightview.js', '/lightview-x.js'],
684
+ styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
685
+ type: 'module',
686
+ minHeight: 250,
687
+ autoRun: true
688
+ });
689
+ </script><code contenteditable="true">await import('/components/data-display/chart.js');
690
+ const { tags, $ } = Lightview;
691
+ const { Chart } = tags;
692
+
693
+ const chart = Chart({
694
+ type: 'line',
695
+ labels: true,
696
+ style: 'width: 100%; max-width: 600px; height: 250px; margin: 0 auto; --color: #7480ff; --line-size: 3px;'
697
+ },
698
+ Chart.Body({},
699
+ Chart.Row({}, Chart.Label({}, 'Jan'), Chart.Data({ start: 0.3, value: 0.5 })),
700
+ Chart.Row({}, Chart.Label({}, 'Feb'), Chart.Data({ start: 0.5, value: 0.7 })),
701
+ Chart.Row({}, Chart.Label({}, 'Mar'), Chart.Data({ start: 0.7, value: 0.6 })),
702
+ Chart.Row({}, Chart.Label({}, 'Apr'), Chart.Data({ start: 0.6, value: 0.9 })),
703
+ Chart.Row({}, Chart.Label({}, 'May'), Chart.Data({ start: 0.9, value: 0.8 }))
704
+ )
705
+ );
706
+
707
+ $('#example').content(chart);</code></pre>
708
+ </div>
709
+
710
+ <!-- vDOM Syntax -->
711
+ <div id="styled-line-syntax-vdom" style="display: none;">
712
+ <pre><script>
713
+ examplify(document.currentScript.nextElementSibling, {
714
+ at: document.currentScript.parentElement,
715
+ scripts: ['/lightview.js', '/lightview-x.js'],
716
+ styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
717
+ type: 'module',
718
+ minHeight: 250
719
+ });
720
+ </script><code contenteditable="true">await import('/components/data-display/chart.js');
721
+ const { tags, $ } = Lightview;
722
+ const { Chart } = tags;
723
+
724
+ const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May'];
725
+ const data = [[0.3, 0.5], [0.5, 0.7], [0.7, 0.6], [0.6, 0.9], [0.9, 0.8]];
726
+
727
+ const chart = {
728
+ tag: Chart,
729
+ attributes: {
730
+ type: 'line',
731
+ labels: true,
732
+ style: 'width: 100%; max-width: 600px; height: 250px; margin: 0 auto; --color: #7480ff; --line-size: 3px;'
733
+ },
734
+ children: [
735
+ {
736
+ tag: Chart.Body,
737
+ children: months.map((month, i) => ({
738
+ tag: Chart.Row,
739
+ children: [
740
+ { tag: Chart.Label, children: [month] },
741
+ { tag: Chart.Data, attributes: { start: data[i][0], value: data[i][1] } }
742
+ ]
743
+ }))
744
+ }
745
+ ]
746
+ };
747
+
748
+ $('#example').content(chart);</code></pre>
749
+ </div>
750
+
751
+ <!-- Object DOM Syntax -->
752
+ <div id="styled-line-syntax-object" style="display: none;">
753
+ <pre><script>
754
+ examplify(document.currentScript.nextElementSibling, {
755
+ at: document.currentScript.parentElement,
756
+ scripts: ['/lightview.js', '/lightview-x.js'],
757
+ styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
758
+ type: 'module',
759
+ minHeight: 250
760
+ });
761
+ </script><code contenteditable="true">await import('/components/data-display/chart.js');
762
+ const { $ } = Lightview;
763
+
764
+ const chart = {
765
+ Chart: {
766
+ type: 'line',
767
+ labels: true,
768
+ style: 'width: 100%; max-width: 600px; height: 250px; margin: 0 auto; --color: #7480ff; --line-size: 3px;',
769
+ children: [
770
+ {
771
+ 'Chart.Body': {
772
+ children: [
773
+ { 'Chart.Row': { children: [{ 'Chart.Label': { children: ['Jan'] } }, { 'Chart.Data': { start: 0.3, value: 0.5 } }] } },
774
+ { 'Chart.Row': { children: [{ 'Chart.Label': { children: ['Feb'] } }, { 'Chart.Data': { start: 0.5, value: 0.7 } }] } },
775
+ { 'Chart.Row': { children: [{ 'Chart.Label': { children: ['Mar'] } }, { 'Chart.Data': { start: 0.7, value: 0.6 } }] } },
776
+ { 'Chart.Row': { children: [{ 'Chart.Label': { children: ['Apr'] } }, { 'Chart.Data': { start: 0.6, value: 0.9 } }] } },
777
+ { 'Chart.Row': { children: [{ 'Chart.Label': { children: ['May'] } }, { 'Chart.Data': { start: 0.9, value: 0.8 } }] } }
778
+ ]
779
+ }
780
+ }
781
+ ]
782
+ }
783
+ };
784
+
785
+ $('#example').content(chart);</code></pre>
786
+ </div>
787
+ </div>
788
+ </div>
789
+
790
+ </div>
791
+ </div>
792
+ </div>
793
+ </div>
794
+ </div>