lightview 1.8.1-b → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -16
- package/docs/CNAME +1 -0
- package/docs/api.html +674 -0
- package/docs/blank.html +10 -0
- package/docs/comparedto.html +89 -0
- package/docs/components/chart-repl.html +69 -0
- package/{components/chart → docs/components}/chart.html +2 -2
- package/{components → docs/components}/components.js +3 -3
- package/docs/components/contents.html +17 -0
- package/docs/components/gantt-repl.html +61 -0
- package/{components/gantt → docs/components}/gantt.html +3 -3
- package/docs/components/gauge-repl.html +66 -0
- package/{components/gauge → docs/components}/gauge.html +2 -2
- package/docs/components/orgchart-repl.html +64 -0
- package/{components/orgchart → docs/components}/orgchart.html +2 -2
- package/docs/components/repl-as-src.html +17 -0
- package/docs/components/repl-repl.html +95 -0
- package/docs/components/repl.html +527 -0
- package/docs/components/timeline-repl.html +72 -0
- package/{components/timeline → docs/components}/timeline.html +2 -2
- package/docs/components.html +14 -0
- package/docs/css/highlightjs.min.css +9 -0
- package/docs/css/tutorial.css +35 -0
- package/docs/examples/anchor.html +11 -0
- package/{examples → docs/examples}/chart.html +2 -2
- package/{examples → docs/examples}/counter.html +1 -1
- package/{examples → docs/examples}/counter.test.mjs +0 -0
- package/{examples → docs/examples}/counter2.html +1 -1
- package/{examples → docs/examples}/directives.html +1 -1
- package/{examples → docs/examples}/foreign.html +1 -1
- package/{examples → docs/examples}/forgeinform.html +1 -1
- package/{examples → docs/examples}/form.html +1 -1
- package/{examples → docs/examples}/gauge.html +2 -2
- package/{examples → docs/examples}/invalid-template-literals.html +1 -1
- package/{examples → docs/examples}/medium/remote.html +1 -1
- package/{examples → docs/examples}/message.html +0 -0
- package/{examples → docs/examples}/nested.html +1 -1
- package/{examples → docs/examples}/object-bound-form.html +0 -0
- package/{examples → docs/examples}/remote-server.js +0 -0
- package/{examples → docs/examples}/remote.html +2 -2
- package/{examples → docs/examples}/remote.json +0 -0
- package/{examples → docs/examples}/scratch.html +1 -1
- package/docs/examples/sensors/index.html +44 -0
- package/{examples → docs/examples}/sensors/sensor-server.js +0 -0
- package/{examples → docs/examples}/shared.html +0 -0
- package/{examples → docs/examples}/template.html +1 -1
- package/{examples → docs/examples}/timeline.html +2 -2
- package/docs/examples/todo.html +40 -0
- package/docs/examples/top.html +10 -0
- package/{examples → docs/examples}/types.html +1 -1
- package/{examples → docs/examples}/xor.html +1 -1
- package/docs/examples.html +25 -0
- package/docs/index.html +44 -0
- package/docs/javascript/codejar.min.js +8 -0
- package/docs/javascript/highlightjs.min.js +1173 -0
- package/docs/javascript/isomorphic-git.js +9 -0
- package/docs/javascript/json5.min.js +1 -0
- package/docs/javascript/lightning-fs.js +1 -0
- package/docs/javascript/lightview.js +1285 -0
- package/docs/javascript/marked.min.js +6 -0
- package/docs/javascript/peerjs.min.js +70 -0
- package/docs/javascript/turndown.js +973 -0
- package/docs/javascript/types.js +606 -0
- package/docs/javascript/utils.js +45 -0
- package/docs/lightview.html +63 -0
- package/docs/old_index.html +965 -0
- package/docs/old_index.md +1132 -0
- package/docs/slidein.html +51 -0
- package/docs/tutorial/0-getting-started.html +67 -0
- package/docs/tutorial/1-intro-to-variables.html +103 -0
- package/docs/tutorial/10-template-components.html +80 -0
- package/docs/tutorial/11-linked-components.html +76 -0
- package/docs/tutorial/12-imported-components.html +67 -0
- package/docs/tutorial/13-input-binding.html +94 -0
- package/docs/tutorial/14-automatic-variable-creation.html +74 -0
- package/docs/tutorial/15-form-binding.html +110 -0
- package/docs/tutorial/16-if-directive.html +60 -0
- package/docs/tutorial/17-loop-directives.html +83 -0
- package/docs/tutorial/18-sanitizing-and-escaping-input.html +79 -0
- package/docs/tutorial/2-imported-and-exported-variables.html +80 -0
- package/docs/tutorial/3-data-types.html +89 -0
- package/docs/tutorial/4-extended-data-types.html +83 -0
- package/docs/tutorial/5-extended-functional-types.html +96 -0
- package/docs/tutorial/5.1-extended-functional-types.html +79 -0
- package/docs/tutorial/5.2-extended-functional-types.html +70 -0
- package/docs/tutorial/6-conventional-javascript.html +75 -0
- package/docs/tutorial/7-monitoring-with-observers.html +107 -0
- package/docs/tutorial/8-event-listeners.html +65 -0
- package/docs/tutorial/9-intro-to-components.html +91 -0
- package/docs/tutorial/contents.html +32 -0
- package/docs/tutorial/my-component.html +29 -0
- package/docs/tutorial/remote-value.json +4 -0
- package/docs/websiterepl.html +46 -0
- package/lightview.js +430 -340
- package/lightview.min.js +1 -0
- package/lightview_good.js +1267 -0
- package/lightview_optimized.js +1274 -0
- package/package.json +1 -1
- package/repl_hold.html +320 -0
- package/test/basic.html +15 -4
- package/test/basic.test.mjs +1 -1
- package/test/extended.html +1 -1
- package/types.js +109 -36
- package/components/chart/example.html +0 -32
- package/components/chart.html +0 -83
- package/components/gantt/example.html +0 -22
- package/components/gauge/example.html +0 -28
- package/components/gauge.html +0 -60
- package/components/orgchart/example.html +0 -25
- package/components/repl/code-editor.html +0 -64
- package/components/repl/editor.html +0 -37
- package/components/repl/editorjs-inline-tool/index.js +0 -3
- package/components/repl/editorjs-inline-tool/inline-tools.js +0 -28
- package/components/repl/editorjs-inline-tool/tool.js +0 -175
- package/components/repl/repl-with-wysiwyg.html +0 -355
- package/components/repl/repl.html +0 -345
- package/components/repl/sup.js +0 -44
- package/components/repl/wysiwyg-repl.html +0 -258
- package/components/timeline/example.html +0 -33
- package/components/timeline.html +0 -81
- package/examples/anchor.html +0 -11
- package/examples/sensors/index.html +0 -30
- package/examples/todo.html +0 -38
- package/examples/top.html +0 -10
- package/sites/client.html +0 -48
- package/sites/index.html +0 -247
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Lightview:ComparedTo</title>
|
|
6
|
+
<script src="./javascript/highlightjs.min.js"></script>
|
|
7
|
+
<script src="./javascript/marked.min.js"></script>
|
|
8
|
+
<script src="./javascript/utils.js"></script>
|
|
9
|
+
<style>
|
|
10
|
+
table { border: lightgray; border-style: solid; border-collapse: collapse; width: 100%}
|
|
11
|
+
thead th:nth-child(1) {
|
|
12
|
+
width: 15%;
|
|
13
|
+
}
|
|
14
|
+
thead th:nth-child(2) {
|
|
15
|
+
width: 17%;
|
|
16
|
+
}
|
|
17
|
+
thead th:nth-child(3) {
|
|
18
|
+
width: 17%;
|
|
19
|
+
}
|
|
20
|
+
thead th:nth-child(4) {
|
|
21
|
+
width: 17%;
|
|
22
|
+
}
|
|
23
|
+
thead th:nth-child(5) {
|
|
24
|
+
width: 17%;
|
|
25
|
+
}
|
|
26
|
+
thead th:nth-child(6) {
|
|
27
|
+
width: 17%;
|
|
28
|
+
}
|
|
29
|
+
th { text-align: left; border: lightgray; border-style: solid; padding: 5px; }
|
|
30
|
+
td { text-align: left; border: lightgray; border-style: solid; padding: 5px; }
|
|
31
|
+
</style>
|
|
32
|
+
</head>
|
|
33
|
+
<body>
|
|
34
|
+
<div class="markdown">
|
|
35
|
+
| |Lightview |Svelte |Vue |React |Riot |
|
|
36
|
+
|-----------|----------|---------|----------|----------|----------|
|
|
37
|
+
| *Size* | 8.5K+ | 1.5K+ | 29K+ | 42K+ | 6.5K+ |
|
|
38
|
+
| *Community Size* | Tiny | Large | Very Large | Very Large | Medium |
|
|
39
|
+
| *Created* | 2022 | 2015 | 2014 | 2011 | 2013 |
|
|
40
|
+
| *Focus* | Small to Medium Projects | Any | Any | Any | Any |
|
|
41
|
+
| *Preprocessor* | No | Yes | For Components | Yes | Yes |
|
|
42
|
+
| *DOM Updates* | Dependency Tracker | Dependency Tracker | VDOM | VDOM | DOM Traversal |
|
|
43
|
+
| *Fully Reactive<sup>1</sup>* | Yes | Yes | Yes | No | No |
|
|
44
|
+
| *Two Way Data Binding<sup>2</sup>* | Optional | No | No | No | No |
|
|
45
|
+
| *Closeness To JavaScript<sup>3</sup>* | 90% | 95% | 80% | 60% | 90% |
|
|
46
|
+
| *Basic Learning Curve<sup>4</sup>* | Very Low | Very Low | Low | High | Very Low |
|
|
47
|
+
| *Power Use Learning Curve<sup>5</sup>* | Moderate | Moderate | High | Very High | Low |
|
|
48
|
+
| *Officially Supported Router* | Future | Yes | Yes | No | Yes |
|
|
49
|
+
| *Officially Supported State Management<sup>6</sup>* | Yes | Yes | Yes | No | ? |
|
|
50
|
+
| *Officially Supported Transition Effects* | No | Yes | Yes | No | No |
|
|
51
|
+
| *Officially Supported Components* | Yes | ? | ? | ? | ? |
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
A version of the most [prevelant UI tool benchmark](https://krausest.github.io/js-framework-benchmark/current.html)
|
|
55
|
+
from Krausest has yet to be published. Internal use of this benchmark shows the current performance of Lightview is close to
|
|
56
|
+
that of Ember (sometimes faster, sometimes slower). It is often as fast or slightly faster than React and sometimes as fast as Vue.
|
|
57
|
+
It is never as fast as Svelte. This should be adequate for many applications. Remember, it is not the
|
|
58
|
+
number of users that impacts a UI library, it is the size and change rate of the DOM that needs to be updated. If
|
|
59
|
+
you don't have thousands of nodes to update or changes of an extremely high frequency, then you should be able to deliver a
|
|
60
|
+
good user experience with Lightview.
|
|
61
|
+
|
|
62
|
+
1. Fully Reactive - Both React and Riot require you to instrument your application with some type of event handlers to
|
|
63
|
+
propagate change. Lightview, Svelte, and Vue can propagate change automatically.
|
|
64
|
+
|
|
65
|
+
2. Closeness To JavaScript - A rough approximation of how "traditional" your code can be and how few extra conventions you need to learn
|
|
66
|
+
to be productive. In general, this relates to the use of state management, attribute directives, annotations, and language additions that
|
|
67
|
+
can't be processed like regular JavaScript.
|
|
68
|
+
|
|
69
|
+
3. Two-way data binding is much maligned. We do understand the issues of tracing data changes through a large application developed over an extended
|
|
70
|
+
period of time by multiple-developers. That being said, Lightview works hard to prevent vicious cycles that creat hard to track bugs and is
|
|
71
|
+
extraordinarily declarative. It is left to you to decide if you want to use two-way data binding. All variables can be monitored with a simple
|
|
72
|
+
call to `addEventListener` without declaring them as `reactive`.
|
|
73
|
+
|
|
74
|
+
4. The learning curves for React are shown as High and Very High due the need to learn JSX, the programming style required, and the need to
|
|
75
|
+
use hooks or manage a fair number of lifecyle events directly. We know this may create some lash back, but we believe the extent of this
|
|
76
|
+
need sometimes makes things as bad as un-restrained use of two-way data binding.
|
|
77
|
+
|
|
78
|
+
5. Riot is listed as `Low` for power use learning curve because it does not provide a lot of extras. This is not to say it isn't powerful, Riot
|
|
79
|
+
focuses on minimalistic simplicity. You can use the rest of JavaScript's native functionality to accomplish what you need.
|
|
80
|
+
|
|
81
|
+
6. State in Lightview is managed with a combination of regular JavaScript objects and the variable functional types `imported`, `exported`, `observed`,
|
|
82
|
+
`reactive`, `remote` and `shared`.
|
|
83
|
+
|
|
84
|
+
</div>
|
|
85
|
+
<script>
|
|
86
|
+
processMarkdown();
|
|
87
|
+
</script>
|
|
88
|
+
</body>
|
|
89
|
+
</html>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Lightview:Components:Basic Charts</title>
|
|
6
|
+
<link href="../css/tutorial.css" rel="stylesheet">
|
|
7
|
+
<link href="../slidein.html" rel="module">
|
|
8
|
+
<link href="repl.html" rel="module">
|
|
9
|
+
<script src="../javascript/highlightjs.min.js"></script>
|
|
10
|
+
<script src="../javascript/marked.min.js"></script>
|
|
11
|
+
<script src="../javascript/utils.js"></script>
|
|
12
|
+
</head>
|
|
13
|
+
<body class="tutorial-body">
|
|
14
|
+
<script src="../javascript/lightview.js"></script>
|
|
15
|
+
<div class="tutorial-instructions">
|
|
16
|
+
<l-slidein src="./contents.html" class="toc"></l-slidein>
|
|
17
|
+
<div class="markdown">
|
|
18
|
+
## Basic Charts
|
|
19
|
+
|
|
20
|
+
The basic chart component, `l-chart`, supports bar, pie, and column charts through configuration data provided as
|
|
21
|
+
relaxed JSON in the tag contetn area.
|
|
22
|
+
|
|
23
|
+
</div>
|
|
24
|
+
<button class="nav-next"><a href="gantt-repl.html" target="content">Next</a></button>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="repl">
|
|
27
|
+
<h2></h2>
|
|
28
|
+
<l-repl id="repl" style="min-height:95vh;min-width:600px;" previewpinned path="$location" previewheight="500px">
|
|
29
|
+
<div slot="headhtml"></div>
|
|
30
|
+
<div slot="bodyhtml"></div>
|
|
31
|
+
<div slot="script"></div>
|
|
32
|
+
<template slot="src">
|
|
33
|
+
<l-head>
|
|
34
|
+
<link href="./chart.html" rel="module">
|
|
35
|
+
<script src="../javascript/lightview.js"></script>
|
|
36
|
+
</l-head>
|
|
37
|
+
<l-body>
|
|
38
|
+
<l-chart id="myPieChart" type="PieChart" style="height:500px;" title="How Much Pizza I Ate Last Night">
|
|
39
|
+
{
|
|
40
|
+
options: { },
|
|
41
|
+
columns: [
|
|
42
|
+
{label: "Topping", type: "string"},
|
|
43
|
+
{label: "Slices", type: "number"}
|
|
44
|
+
],
|
|
45
|
+
rows: [
|
|
46
|
+
["Mushrooms", 3],
|
|
47
|
+
["Onions", 1],
|
|
48
|
+
["Olives", 1],
|
|
49
|
+
["Zucchini", 1],
|
|
50
|
+
["Pepperoni", 2]
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
</l-chart>
|
|
54
|
+
</l-body>
|
|
55
|
+
<script>
|
|
56
|
+
const el = document.getElementById("myPieChart");
|
|
57
|
+
el.addEventListener("initialized",() => {
|
|
58
|
+
const chart = el.chart;
|
|
59
|
+
chart.addRow(["Anchovies",1]);
|
|
60
|
+
});
|
|
61
|
+
</script>
|
|
62
|
+
</template>
|
|
63
|
+
</l-repl>
|
|
64
|
+
</div>
|
|
65
|
+
<script>
|
|
66
|
+
processMarkdown();
|
|
67
|
+
</script>
|
|
68
|
+
</body>
|
|
69
|
+
</html>
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<title>Lightview:Component:Chart</title>
|
|
6
|
+
<script src="../javascript/json5.min.js"></script>
|
|
6
7
|
</head>
|
|
7
8
|
<body>
|
|
8
9
|
<div id="target"></div>
|
|
9
|
-
<script src="https://unpkg.com/json5@^2.0.0/dist/index.min.js"></script>
|
|
10
10
|
<script id="lightview">
|
|
11
11
|
(document.currentComponent||(document.currentComponent=document.body)).mount = async function() {
|
|
12
|
-
const {chart} = await import(new URL("
|
|
12
|
+
const {chart} = await import(new URL("./components.js", this.componentBaseURI).href);
|
|
13
13
|
chart(self);
|
|
14
14
|
}
|
|
15
15
|
</script>
|
|
@@ -94,9 +94,9 @@ const chart = (self,{packages = ["corechart"],options={},columns=[],rows=[],type
|
|
|
94
94
|
node.characterDataMutationCallback = callback;
|
|
95
95
|
// resized charts if window resizes
|
|
96
96
|
resizeObserver.observe(document.body);
|
|
97
|
-
self.dispatchEvent(new Event("
|
|
97
|
+
self.dispatchEvent(new Event("initialized"));
|
|
98
98
|
};
|
|
99
|
-
self.addEventListener("
|
|
99
|
+
self.addEventListener("mounted", ({target}) => {
|
|
100
100
|
const gscript = document.createElement("script");
|
|
101
101
|
gscript.setAttribute("src","https://www.gstatic.com/charts/loader.js");
|
|
102
102
|
gscript.onload = () => {
|
|
@@ -106,7 +106,7 @@ const chart = (self,{packages = ["corechart"],options={},columns=[],rows=[],type
|
|
|
106
106
|
self.appendChild(gscript);
|
|
107
107
|
});
|
|
108
108
|
const jscript = document.createElement("script");
|
|
109
|
-
jscript.setAttribute("src","
|
|
109
|
+
jscript.setAttribute("src","../javascript/json5.min.js");
|
|
110
110
|
document.head.appendChild(jscript);
|
|
111
111
|
}
|
|
112
112
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Ligtchview:Tutorial:Contents</title>
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<ul style="list-style:none;padding-inline-start: 10px">
|
|
9
|
+
<li><a href="./chart-repl.html">Basic Charts</a></li>
|
|
10
|
+
<li><a href="./gantt-repl.html">Gantt</a></li>
|
|
11
|
+
<li><a href="./orgchart-repl.html">Org Chart</a></li>
|
|
12
|
+
<li><a href="./timeline-repl.html">Timeline</a></li>
|
|
13
|
+
<li><a href="./gauge-repl.html">Gauge</a></li>
|
|
14
|
+
<li><a href="./repl-repl.html">REPL</a></li>
|
|
15
|
+
</ul>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Lightview:Components:Gantt</title>
|
|
6
|
+
<link href="../css/tutorial.css" rel="stylesheet">
|
|
7
|
+
<link href="../slidein.html" rel="module">
|
|
8
|
+
<link href="repl.html" rel="module">
|
|
9
|
+
<script src="../javascript/highlightjs.min.js"></script>
|
|
10
|
+
<script src="../javascript/marked.min.js"></script>
|
|
11
|
+
<script src="../javascript/utils.js"></script>
|
|
12
|
+
</head>
|
|
13
|
+
<body class="tutorial-body">
|
|
14
|
+
<script src="../javascript/lightview.js"></script>
|
|
15
|
+
<div class="tutorial-instructions">
|
|
16
|
+
<l-slidein src="./contents.html" class="toc"></l-slidein>
|
|
17
|
+
<div class="markdown">
|
|
18
|
+
## Gannt
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
</div>
|
|
23
|
+
<button class="nav-previous"><a href="chart-repl.html" target="content">Previous</a></button>
|
|
24
|
+
<button class="nav-next"><a href="orgchart-repl.html" target="content">Next</a></button>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="repl">
|
|
27
|
+
<h2></h2>
|
|
28
|
+
<l-repl id="repl" style="min-height:95vh;min-width:600px;" previewpinned path="$location" previewheight="400px">
|
|
29
|
+
<div slot="headhtml"></div>
|
|
30
|
+
<div slot="bodyhtml"></div>
|
|
31
|
+
<div slot="script"></div>
|
|
32
|
+
<template slot="src">
|
|
33
|
+
<l-head>
|
|
34
|
+
<link href="./gantt.html" rel="module">
|
|
35
|
+
<script src="../javascript/lightview.js"></script>
|
|
36
|
+
</l-head>
|
|
37
|
+
<l-body>
|
|
38
|
+
<l-gantt id="myChart" style="height:400px;" title="Research Project">
|
|
39
|
+
{
|
|
40
|
+
options: { },
|
|
41
|
+
rows: [
|
|
42
|
+
['Research', 'Find sources',"2015-01-01", "2015-01-05", null, 100, null],
|
|
43
|
+
['Write', 'Write paper',null,"2015-01-09", "3d", 25, 'Research,Outline'],
|
|
44
|
+
['Cite', 'Create bibliography',null, "2015-01-07","1d" , 20, 'Research'],
|
|
45
|
+
['Complete', 'Hand in paper', null, "2015-01-10", "1d" , 0, 'Cite,Write'],
|
|
46
|
+
['Outline', 'Outline paper', null, "2015-01-06", "1d" , 100, 'Research']
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
</l-gantt>
|
|
50
|
+
</l-body>
|
|
51
|
+
<script>
|
|
52
|
+
|
|
53
|
+
</script>
|
|
54
|
+
</template>
|
|
55
|
+
</l-repl>
|
|
56
|
+
</div>
|
|
57
|
+
<script>
|
|
58
|
+
processMarkdown();
|
|
59
|
+
</script>
|
|
60
|
+
</body>
|
|
61
|
+
</html>
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<title>Lightview:Component:Gantt</title>
|
|
5
|
+
<script src="../javascript/json5.min.js"></script>
|
|
5
6
|
</head>
|
|
6
7
|
<body>
|
|
7
8
|
<div id="target"></div>
|
|
8
|
-
<script src="https://unpkg.com/json5@^2.0.0/dist/index.min.js"></script>
|
|
9
9
|
<script id="lightview">
|
|
10
10
|
(document.currentComponent||(document.currentComponent=document.body)).mount = async function() {
|
|
11
|
-
const {chart} = await import("
|
|
12
|
-
{duration} = await import("/types.js");
|
|
11
|
+
const {chart} = await import(new URL("./components.js", this.componentBaseURI).href),
|
|
12
|
+
{duration} = await import(new URL("../javascript/types.js", this.componentBaseURI).href);
|
|
13
13
|
chart(self, {
|
|
14
14
|
packages: ["gantt"],
|
|
15
15
|
columns: [
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Lightview:Components:Gauge</title>
|
|
6
|
+
<link href="../css/tutorial.css" rel="stylesheet">
|
|
7
|
+
<link href="../slidein.html" rel="module">
|
|
8
|
+
<link href="repl.html" rel="module">
|
|
9
|
+
<script src="../javascript/highlightjs.min.js"></script>
|
|
10
|
+
<script src="../javascript/marked.min.js"></script>
|
|
11
|
+
<script src="../javascript/utils.js"></script>
|
|
12
|
+
</head>
|
|
13
|
+
<body class="tutorial-body">
|
|
14
|
+
<script src="../javascript/lightview.js"></script>
|
|
15
|
+
<div class="tutorial-instructions">
|
|
16
|
+
<l-slidein src="./contents.html" class="toc"></l-slidein>
|
|
17
|
+
<div class="markdown">
|
|
18
|
+
## Gauge
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
</div>
|
|
23
|
+
<button class="nav-previous"><a href="timeline-repl.html" target="content">Previous</a></button>
|
|
24
|
+
<button class="nav-next"><a href="repl-repl.html" target="content">Next</a></button>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="repl">
|
|
27
|
+
<h2></h2>
|
|
28
|
+
<l-repl id="repl" style="min-height:95vh;min-width:600px;" previewpinned path="$location" previewheight="400px">
|
|
29
|
+
<div slot="headhtml"></div>
|
|
30
|
+
<div slot="bodyhtml"></div>
|
|
31
|
+
<div slot="script"></div>
|
|
32
|
+
<template slot="src">
|
|
33
|
+
<l-head>
|
|
34
|
+
<link href="./gauge.html" rel="module">
|
|
35
|
+
<script src="../javascript/lightview.js"></script>
|
|
36
|
+
</l-head>
|
|
37
|
+
<l-body>
|
|
38
|
+
<l-gauge id="myChart" style="height:500px;" title="Server" hidden l-unhide>
|
|
39
|
+
{
|
|
40
|
+
options: {
|
|
41
|
+
|
|
42
|
+
},
|
|
43
|
+
rows: [
|
|
44
|
+
['Memory', 80],
|
|
45
|
+
['CPU', 55],
|
|
46
|
+
['Network', 68]
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
</l-gauge>
|
|
50
|
+
|
|
51
|
+
</l-body>
|
|
52
|
+
<script>
|
|
53
|
+
const el = document.getElementById("myChart");
|
|
54
|
+
el.addEventListener("initialized",() => {
|
|
55
|
+
chart = el.chart;
|
|
56
|
+
chart.addRow(["Storage",10]);
|
|
57
|
+
});
|
|
58
|
+
</script>
|
|
59
|
+
</template>
|
|
60
|
+
</l-repl>
|
|
61
|
+
</div>
|
|
62
|
+
<script>
|
|
63
|
+
processMarkdown();
|
|
64
|
+
</script>
|
|
65
|
+
</body>
|
|
66
|
+
</html>
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
<head>
|
|
3
3
|
<meta charset="UTF-8">
|
|
4
4
|
<title>Lightview:Component:Gauge</title>
|
|
5
|
+
<script src="../javascript/json5.min.js"></script>
|
|
5
6
|
</head>
|
|
6
7
|
<body>
|
|
7
8
|
<div id="target"></div>
|
|
8
|
-
<script src="https://unpkg.com/json5@^2.0.0/dist/index.min.js"></script>
|
|
9
9
|
<script id="lightview">
|
|
10
10
|
(document.currentComponent||(document.currentComponent=document.body)).mount = async function() {
|
|
11
|
-
const {chart} = await import("
|
|
11
|
+
const {chart} = await import(new URL("./components.js", this.componentBaseURI).href);
|
|
12
12
|
chart(self, {
|
|
13
13
|
packages: ["corechart", "gauge"],
|
|
14
14
|
columns: [{label: "Label", type: "string"}, {label: "Value", type: "number"}],
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Lightview:Components:Org Chart</title>
|
|
6
|
+
<link href="../css/tutorial.css" rel="stylesheet">
|
|
7
|
+
<link href="../slidein.html" rel="module">
|
|
8
|
+
<link href="repl.html" rel="module">
|
|
9
|
+
<script src="../javascript/highlightjs.min.js"></script>
|
|
10
|
+
<script src="../javascript/marked.min.js"></script>
|
|
11
|
+
<script src="../javascript/utils.js"></script>
|
|
12
|
+
</head>
|
|
13
|
+
<body class="tutorial-body">
|
|
14
|
+
<script src="../javascript/lightview.js"></script>
|
|
15
|
+
<div class="tutorial-instructions">
|
|
16
|
+
<l-slidein src="./contents.html" class="toc"></l-slidein>
|
|
17
|
+
<div class="markdown">
|
|
18
|
+
## Org Chart
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
</div>
|
|
23
|
+
<button class="nav-previous"><a href="gantt-repl.html" target="content">Previous</a></button>
|
|
24
|
+
<button class="nav-next"><a href="timeline-repl.html" target="content">Next</a></button>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="repl">
|
|
27
|
+
<h2></h2>
|
|
28
|
+
<l-repl id="repl" style="min-height:95vh;min-width:600px;" previewpinned path="$location" previewheight="400px">
|
|
29
|
+
<div slot="headhtml"></div>
|
|
30
|
+
<div slot="bodyhtml"></div>
|
|
31
|
+
<div slot="script"></div>
|
|
32
|
+
<template slot="src">
|
|
33
|
+
<l-head>
|
|
34
|
+
<link href="./orgchart.html" rel="module">
|
|
35
|
+
<script src="../javascript/lightview.js"></script>
|
|
36
|
+
</l-head>
|
|
37
|
+
<l-body>
|
|
38
|
+
<l-orgchart id="myChart" style="height:500px;" title="My Org">
|
|
39
|
+
{
|
|
40
|
+
options: {
|
|
41
|
+
selectedStyle:"color:red"
|
|
42
|
+
},
|
|
43
|
+
// 4 columns in definition data name,title,manager,tooltip
|
|
44
|
+
rows: [
|
|
45
|
+
["Mike","President","",""],
|
|
46
|
+
["Jim","CFO","Mike",""],
|
|
47
|
+
['Alice', 'Controller','Jim',""],
|
|
48
|
+
['Bob', 'CIO', 'Mike',""],
|
|
49
|
+
['Carol', 'Executive Assistant',"Mike",""]
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
</l-orgchart>
|
|
53
|
+
</l-body>
|
|
54
|
+
<script>
|
|
55
|
+
|
|
56
|
+
</script>
|
|
57
|
+
</template>
|
|
58
|
+
</l-repl>
|
|
59
|
+
</div>
|
|
60
|
+
<script>
|
|
61
|
+
processMarkdown();
|
|
62
|
+
</script>
|
|
63
|
+
</body>
|
|
64
|
+
</html>
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<title>Lightview:Component:OrgChart</title>
|
|
5
|
-
<script src="
|
|
5
|
+
<script src="../javascript/json5.min.js"></script>
|
|
6
6
|
</head>
|
|
7
7
|
<body>
|
|
8
8
|
<link id="load-css-2" rel="stylesheet" type="text/css" href="https://www.gstatic.com/charts/51/css/orgchart/orgchart.css">
|
|
9
9
|
<div id="target"></div>
|
|
10
10
|
<script id="lightview">
|
|
11
11
|
(document.currentComponent||(document.currentComponent=document.body)).mount = async function() {
|
|
12
|
-
const {chart} = await import("
|
|
12
|
+
const {chart} = await import(new URL("./components.js", this.componentBaseURI).href);
|
|
13
13
|
chart(self, {
|
|
14
14
|
options: {allowHtml: true, allowCollapse: true},
|
|
15
15
|
packages: ["orgchart"],
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<script src="../javascript/lightview.js?as=x-body"></script>
|
|
5
|
+
</head>
|
|
6
|
+
<body>
|
|
7
|
+
<div class="message">${message}</div>
|
|
8
|
+
<script id="lightview">
|
|
9
|
+
currentComponent.mount = function() {
|
|
10
|
+
this.variables({message:"string"},{set:"Hello world!"});
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
<style>
|
|
14
|
+
.message { font-size: large }
|
|
15
|
+
</style>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Lightview:Components:REPL</title>
|
|
6
|
+
<link href="../css/tutorial.css" rel="stylesheet">
|
|
7
|
+
<link href="../slidein.html" rel="module">
|
|
8
|
+
<link href="repl.html" rel="module">
|
|
9
|
+
<script src="../javascript/highlightjs.min.js"></script>
|
|
10
|
+
<script src="../javascript/marked.min.js"></script>
|
|
11
|
+
<script src="../javascript/utils.js"></script>
|
|
12
|
+
</head>
|
|
13
|
+
<body class="tutorial-body">
|
|
14
|
+
<script src="../javascript/lightview.js"></script>
|
|
15
|
+
<div class="tutorial-instructions">
|
|
16
|
+
<l-slidein src="./contents.html" class="toc"></l-slidein>
|
|
17
|
+
<div class="markdown">
|
|
18
|
+
## REPL
|
|
19
|
+
|
|
20
|
+
REPL itself is a component, `l-repl`.
|
|
21
|
+
|
|
22
|
+
To the right you will see source similar to that used to define the REPL in the tab menu for this website.
|
|
23
|
+
|
|
24
|
+
The REPL component has lots of configuration options, so you can use it to just display example code based on
|
|
25
|
+
source files if you want or focus users on a specific aspect of the code.
|
|
26
|
+
|
|
27
|
+
Try these steps to see the flexibility of `l-repl`:
|
|
28
|
+
|
|
29
|
+
1. Delete the entire slot and its contents starting with `<template slot="src"> ... </template>`. You should now
|
|
30
|
+
see a REPL with no content in each of the displayed areas.
|
|
31
|
+
2. Paste `src="./repl-as-src.html"` as one of the attributes of the `l-repl`. You should now see the same code you
|
|
32
|
+
saw to start with, except it is loaded from a file.
|
|
33
|
+
3. Paste `readonly` as an attribute to the `l-repl`. Now, none of the code can be edited. also, the `Save` button in the
|
|
34
|
+
frames section disappears. (You probably realized this by now, users can save their REPL edits to `IndexedDB` locally. Next time
|
|
35
|
+
they visit, the REPL will be in the same state it was left in ... unless it has been more than 10 days on IOS ... Apple
|
|
36
|
+
auto clears `IndexedDB for lack of use ;-(.).
|
|
37
|
+
4. Delete `readonly` from the `l-repl` (Ctrl-Z should work) and paste it as an attribute to "bodyhtml" slot. Now the body
|
|
38
|
+
can't be edited. You can do this with the other slots also.
|
|
39
|
+
5. Remove `previewpinned` so as not to distract the user with a preview unless it is requested.
|
|
40
|
+
5. Assume you want to focus the user attention of the body and script without editing. Remove the
|
|
41
|
+
slots "headhtml" and "css". Add "readonly" to the "script" slot, or the `l-repl`. Remove `previewheight`.
|
|
42
|
+
Add `hidetabs` to the `l-repl`.
|
|
43
|
+
|
|
44
|
+
One final note, if you want to use multiple script tags, then add `maintainbody` to the `l-repl` and your scripts will be
|
|
45
|
+
left alone, otherwise, the `l-repl` assumes you only have one script.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
</div>
|
|
49
|
+
<button class="nav-previous"><a href="gauge-repl.html" target="content">Previous</a></button>
|
|
50
|
+
</div>
|
|
51
|
+
<div class="repl">
|
|
52
|
+
<h2></h2>
|
|
53
|
+
<l-repl id="repl" style="min-height:95vh;min-width:600px;" previewpinned path="$location" previewheight="750px" maintainbody>
|
|
54
|
+
<div slot="headhtml"></div>
|
|
55
|
+
<div slot="bodyhtml"></div>
|
|
56
|
+
<div slot="script"></div>
|
|
57
|
+
<div slot="css"></div>
|
|
58
|
+
<template slot="src">
|
|
59
|
+
<l-head>
|
|
60
|
+
<link href="./repl.html" rel="module">
|
|
61
|
+
<script src="../javascript/lightview.js"></script>
|
|
62
|
+
</l-head>
|
|
63
|
+
<l-body>
|
|
64
|
+
<l-repl id="repl" style="min-height:95vh;min-width:600px;" previewpinned previewheight="250px">
|
|
65
|
+
<div slot="headhtml"></div>
|
|
66
|
+
<div slot="bodyhtml"></div>
|
|
67
|
+
<div slot="script"></div>
|
|
68
|
+
<div slot="css"></div>
|
|
69
|
+
<template slot="src">
|
|
70
|
+
<l-head>
|
|
71
|
+
<script src="../javascript/lightview.js?as=x-body"></script>
|
|
72
|
+
</l-head>
|
|
73
|
+
<l-body>
|
|
74
|
+
<div class="message">${message}</div>
|
|
75
|
+
</l-body>
|
|
76
|
+
<script id="lightview">
|
|
77
|
+
currentComponent.mount = function() {
|
|
78
|
+
this.variables({message:"string"},{set:"Hello world!"});
|
|
79
|
+
}
|
|
80
|
+
</script>
|
|
81
|
+
<style>
|
|
82
|
+
.message { font-size: large }
|
|
83
|
+
</style>
|
|
84
|
+
</template>
|
|
85
|
+
</l-repl>
|
|
86
|
+
</l-body>
|
|
87
|
+
|
|
88
|
+
</template>
|
|
89
|
+
</l-repl>
|
|
90
|
+
</div>
|
|
91
|
+
<script>
|
|
92
|
+
processMarkdown();
|
|
93
|
+
</script>
|
|
94
|
+
</body>
|
|
95
|
+
</html>
|