jsgui3-server 0.0.144 → 0.0.145
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/docs/jsgui3-html-improvement-ideas.md +162 -0
- package/docs/jsgui3-html-improvement-ideas.svg +151 -0
- package/examples/controls/14d) window, canvas globe/EarthGlobeRenderer.js +19 -14
- package/examples/controls/14d) window, canvas globe/pipeline/TransformStage.js +5 -5
- package/examples/jsgui3-html/01) mvvm-counter/client.js +648 -0
- package/examples/jsgui3-html/01) mvvm-counter/server.js +21 -0
- package/examples/jsgui3-html/02) date-transform/client.js +764 -0
- package/examples/jsgui3-html/02) date-transform/server.js +21 -0
- package/examples/jsgui3-html/03) form-validation/client.js +1045 -0
- package/examples/jsgui3-html/03) form-validation/server.js +21 -0
- package/examples/jsgui3-html/04) data-grid/client.js +738 -0
- package/examples/jsgui3-html/04) data-grid/server.js +21 -0
- package/examples/jsgui3-html/05) master-detail/client.js +649 -0
- package/examples/jsgui3-html/05) master-detail/server.js +21 -0
- package/examples/jsgui3-html/06) theming/client.js +514 -0
- package/examples/jsgui3-html/06) theming/server.js +21 -0
- package/examples/jsgui3-html/07) mixins/client.js +465 -0
- package/examples/jsgui3-html/07) mixins/server.js +21 -0
- package/examples/jsgui3-html/08) router/client.js +372 -0
- package/examples/jsgui3-html/08) router/server.js +21 -0
- package/examples/jsgui3-html/09) resource-transform/client.js +692 -0
- package/examples/jsgui3-html/09) resource-transform/server.js +21 -0
- package/examples/jsgui3-html/10) binding-debugger/client.js +810 -0
- package/examples/jsgui3-html/10) binding-debugger/server.js +21 -0
- package/examples/jsgui3-html/README.md +48 -0
- package/http/responders/static/Static_Route_HTTP_Responder.js +25 -20
- package/package.json +3 -3
- package/publishers/http-webpageorsite-publisher.js +3 -1
- package/serve-factory.js +12 -5
- package/server.js +103 -85
- package/tests/README.md +7 -0
- package/tests/end-to-end.test.js +336 -365
- package/tests/examples-controls.e2e.test.js +13 -1
- package/tests/fixtures/end-to-end-client.js +54 -0
- package/tests/fixtures/jsgui3-html/binding_debugger_expectations.json +15 -0
- package/tests/fixtures/jsgui3-html/counter_expectations.json +31 -0
- package/tests/fixtures/jsgui3-html/data_grid_expectations.json +26 -0
- package/tests/fixtures/jsgui3-html/date_transform_expectations.json +26 -0
- package/tests/fixtures/jsgui3-html/form_validation_expectations.json +27 -0
- package/tests/fixtures/jsgui3-html/master_detail_expectations.json +15 -0
- package/tests/fixtures/jsgui3-html/mixins_expectations.json +10 -0
- package/tests/fixtures/jsgui3-html/resource_transform_expectations.json +11 -0
- package/tests/fixtures/jsgui3-html/router_expectations.json +10 -0
- package/tests/fixtures/jsgui3-html/theming_expectations.json +10 -0
- package/tests/jsgui3-html-examples.puppeteer.test.js +537 -0
- package/tests/test-runner.js +1 -0
- package/tests/window-examples.puppeteer.test.js +217 -1
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# JSGUI3-HTML Improvement Ideas
|
|
2
|
+
|
|
3
|
+
This document outlines improvement opportunities for `jsgui3-html` controls based on inspecting the current control catalog under `node_modules/jsgui3-html/controls`.
|
|
4
|
+
|
|
5
|
+
## Control Inventory Snapshot (Observed)
|
|
6
|
+
|
|
7
|
+
Source: `node_modules/jsgui3-html/controls/controls.js` and `controls/organised/*`.
|
|
8
|
+
|
|
9
|
+
### Core (0-core)
|
|
10
|
+
|
|
11
|
+
- 0-basic / 0-native-compositional
|
|
12
|
+
- button, checkbox, date-picker, dropdown-list, file-upload, icon, radio-button, Select_Options, Text_Input
|
|
13
|
+
- 0-basic / 1-compositional
|
|
14
|
+
- calendar, combo-box, context-menu, color-grid, color-palette, grid, list, scroll-view, scrollbar
|
|
15
|
+
- item, item-selector, menu-node, month-view, text-item, Text_Field
|
|
16
|
+
- toggle-button, plus-minus-toggle-button, radio-button-group, timespan-selector
|
|
17
|
+
- status indicators: Indicator, Status_Indicator, Validation_Status_Indicator
|
|
18
|
+
- 0-core / 1-advanced
|
|
19
|
+
- Canvas, login, popup-menu-button, string-span
|
|
20
|
+
|
|
21
|
+
### Standard (1-standard)
|
|
22
|
+
|
|
23
|
+
- 0-viewer
|
|
24
|
+
- array, object, object-kvp, number, string
|
|
25
|
+
- 1-editor
|
|
26
|
+
- form_field / FormField, PropertyEditor / property_editor, Rich_Text_Editor
|
|
27
|
+
- array/object/number/string editors
|
|
28
|
+
- 2-misc
|
|
29
|
+
- left-right-arrows-selector, up-down-arrow-buttons
|
|
30
|
+
- 3-page
|
|
31
|
+
- standard-web-page, message-web-page
|
|
32
|
+
- 4-data
|
|
33
|
+
- data-item, data-row, data-filter
|
|
34
|
+
- 5-ui
|
|
35
|
+
- tree, tree-node, file-tree, file-tree-node
|
|
36
|
+
- toolbar, toolbox, horizontal-menu, horizontal-slider
|
|
37
|
+
- line-chart, search-bar, audio-volume, media-scrubber
|
|
38
|
+
- 6-layout
|
|
39
|
+
- panel, titled-panel, title-bar, window, modal
|
|
40
|
+
- tabbed-panel, tile-slide, vertical-expander, single-line
|
|
41
|
+
- app/multi-layout-mode
|
|
42
|
+
|
|
43
|
+
### Showcase (2-showcase)
|
|
44
|
+
|
|
45
|
+
- icon-library
|
|
46
|
+
|
|
47
|
+
### Notes / Legacy
|
|
48
|
+
|
|
49
|
+
- `controls/connected/data-grid.js` exists but is commented out in `controls.js`.
|
|
50
|
+
- `controls/old/*` contains historical controls (item, item-view).
|
|
51
|
+
- `controls/swaps/notes.md` references progressive enhancement and swapping native controls.
|
|
52
|
+
- Naming duplication: `FormField.js` vs `form_field.js`, `PropertyEditor.js` vs `property_editor.js`.
|
|
53
|
+
|
|
54
|
+
## Improvement Themes
|
|
55
|
+
|
|
56
|
+
### 1) Add Missing Core Controls
|
|
57
|
+
|
|
58
|
+
These should be small, reliable building blocks with strong HTML parity and predictable activation.
|
|
59
|
+
|
|
60
|
+
- Textarea
|
|
61
|
+
- Password, email, url, tel inputs
|
|
62
|
+
- Number input with stepper (native + stylized)
|
|
63
|
+
- Range slider (native) + stepped slider
|
|
64
|
+
- Progress bar, meter
|
|
65
|
+
- Switch/toggle (native checkbox + styled)
|
|
66
|
+
- Chip/tag input
|
|
67
|
+
- Inline validation message control
|
|
68
|
+
- Breadcrumbs, pagination
|
|
69
|
+
- Tooltip/popover
|
|
70
|
+
- Notification/toast, alert banner
|
|
71
|
+
- Badge/pill
|
|
72
|
+
|
|
73
|
+
### 2) Data & Collection Controls
|
|
74
|
+
|
|
75
|
+
The existing data controls are minimal; add richer, reusable data views.
|
|
76
|
+
|
|
77
|
+
- Data table with sorting, filtering, pagination
|
|
78
|
+
- Virtualized list/grid for large datasets
|
|
79
|
+
- Tree-table hybrid (folders with columns)
|
|
80
|
+
- List reordering (drag-and-drop)
|
|
81
|
+
- Master/detail split view
|
|
82
|
+
- Data grid should reconnect to `controls/connected/data-grid.js` with a modern API
|
|
83
|
+
|
|
84
|
+
### 3) Layout + Navigation Expansion
|
|
85
|
+
|
|
86
|
+
The layout set is strong but missing higher-level patterns.
|
|
87
|
+
|
|
88
|
+
- Split pane / resizable panes
|
|
89
|
+
- Accordion / collapsible sections
|
|
90
|
+
- Sidebar + responsive drawer
|
|
91
|
+
- Tab variants (vertical, icon tabs, overflow)
|
|
92
|
+
- Stepper / wizard layout
|
|
93
|
+
- Layout primitives: stack, cluster, center, grid-with-gap
|
|
94
|
+
|
|
95
|
+
### 4) Form & Editor Features
|
|
96
|
+
|
|
97
|
+
Existing editors need feature depth, validation, and accessibility.
|
|
98
|
+
|
|
99
|
+
- Form container with built-in validation routing
|
|
100
|
+
- Field-level error display + status badges
|
|
101
|
+
- Input masking (date, currency, phone)
|
|
102
|
+
- Autosize text field / textarea
|
|
103
|
+
- Rich text editor improvements: toolbar, markdown, paste sanitization
|
|
104
|
+
- Object editor: expand/collapse, add/remove key-values, schema-driven rendering
|
|
105
|
+
|
|
106
|
+
### 5) Feature Depth for Existing Controls
|
|
107
|
+
|
|
108
|
+
Concrete enhancements based on a quick control scan:
|
|
109
|
+
|
|
110
|
+
- Checkbox: fix `el_radio` typo in change handler, add `checked` sync, keyboard focus state
|
|
111
|
+
- Date picker: add min/max, locale formatting, keyboard navigation, week start configuration
|
|
112
|
+
- Dropdown/list/combobox: async options, filtering, typeahead, ARIA roles
|
|
113
|
+
- Window/panel: snap, dock, maximize, z-index management, resize handles
|
|
114
|
+
- Tree/file tree: lazy loading, multi-select, drag reparent, keyboard navigation
|
|
115
|
+
- Scrollbar/scroll-view: horizontal + vertical sync, scroll inertia
|
|
116
|
+
|
|
117
|
+
### 6) Accessibility + Semantics
|
|
118
|
+
|
|
119
|
+
- Standardize ARIA roles, labels, and keyboard handling
|
|
120
|
+
- Focus ring consistency and tab order control
|
|
121
|
+
- High contrast mode + reduced motion theme
|
|
122
|
+
- Screen reader text for icon-only buttons
|
|
123
|
+
|
|
124
|
+
### 7) Theming + Styling System
|
|
125
|
+
|
|
126
|
+
- Token-driven theme layer (color, spacing, radius, typography)
|
|
127
|
+
- Control style overrides via theme context
|
|
128
|
+
- Light/dark/system themes with CSS variables
|
|
129
|
+
- CSS layering: base, component, utility
|
|
130
|
+
- Improve `swaps` approach for progressive enhancement of native elements
|
|
131
|
+
|
|
132
|
+
### 8) Consistency + Packaging
|
|
133
|
+
|
|
134
|
+
- Normalize naming and case conventions in control filenames
|
|
135
|
+
- Reduce duplicate editor components (FormField vs form_field)
|
|
136
|
+
- Clarify which controls are core vs showcase
|
|
137
|
+
- Provide explicit exports for stable public API
|
|
138
|
+
|
|
139
|
+
## Suggested Roadmap
|
|
140
|
+
|
|
141
|
+
### Phase 1: Core and Reliability
|
|
142
|
+
|
|
143
|
+
- Add missing native inputs (textarea, number, range)
|
|
144
|
+
- Fix known control bugs (checkbox `el_radio` reference)
|
|
145
|
+
- Normalize control naming duplication
|
|
146
|
+
- Basic accessibility pass across core controls
|
|
147
|
+
|
|
148
|
+
### Phase 2: Data + Forms
|
|
149
|
+
|
|
150
|
+
- Data table + virtualized list
|
|
151
|
+
- Form container + validation hooks
|
|
152
|
+
- Object editor improvements
|
|
153
|
+
|
|
154
|
+
### Phase 3: Layout + UX Features
|
|
155
|
+
|
|
156
|
+
- Split panes, accordion, responsive drawer
|
|
157
|
+
- Enhanced window management
|
|
158
|
+
- Theme system and style tokens
|
|
159
|
+
|
|
160
|
+
## Visual Summary
|
|
161
|
+
|
|
162
|
+
See `docs/jsgui3-html-improvement-ideas.svg` for an Industrial Luxury Obsidian themed diagram of these ideas.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="1000" viewBox="0 0 1600 1000" role="img" aria-label="JSGUI3-HTML improvement ideas diagram">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="bg_grad" x1="0" y1="0" x2="1" y2="1">
|
|
4
|
+
<stop offset="0%" stop-color="#0a0b0e" />
|
|
5
|
+
<stop offset="45%" stop-color="#101419" />
|
|
6
|
+
<stop offset="100%" stop-color="#141a20" />
|
|
7
|
+
</linearGradient>
|
|
8
|
+
<radialGradient id="highlight_grad" cx="70%" cy="20%" r="60%">
|
|
9
|
+
<stop offset="0%" stop-color="#2a2f36" stop-opacity="0.7" />
|
|
10
|
+
<stop offset="70%" stop-color="#0a0b0e" stop-opacity="0" />
|
|
11
|
+
</radialGradient>
|
|
12
|
+
<linearGradient id="gold_grad" x1="0" y1="0" x2="1" y2="0">
|
|
13
|
+
<stop offset="0%" stop-color="#8f7a3c" />
|
|
14
|
+
<stop offset="50%" stop-color="#d2b86a" />
|
|
15
|
+
<stop offset="100%" stop-color="#8f7a3c" />
|
|
16
|
+
</linearGradient>
|
|
17
|
+
<linearGradient id="steel_grad" x1="0" y1="0" x2="0" y2="1">
|
|
18
|
+
<stop offset="0%" stop-color="#1b2127" />
|
|
19
|
+
<stop offset="100%" stop-color="#11151a" />
|
|
20
|
+
</linearGradient>
|
|
21
|
+
<pattern id="grid_pattern" width="40" height="40" patternUnits="userSpaceOnUse">
|
|
22
|
+
<path d="M 40 0 L 0 0 0 40" fill="none" stroke="#1a2026" stroke-width="1" />
|
|
23
|
+
</pattern>
|
|
24
|
+
<filter id="soft_glow" x="-50%" y="-50%" width="200%" height="200%">
|
|
25
|
+
<feDropShadow dx="0" dy="0" stdDeviation="6" flood-color="#c9b26b" flood-opacity="0.4" />
|
|
26
|
+
</filter>
|
|
27
|
+
<filter id="panel_shadow" x="-50%" y="-50%" width="200%" height="200%">
|
|
28
|
+
<feDropShadow dx="0" dy="4" stdDeviation="10" flood-color="#000000" flood-opacity="0.6" />
|
|
29
|
+
</filter>
|
|
30
|
+
</defs>
|
|
31
|
+
|
|
32
|
+
<rect width="1600" height="1000" fill="url(#bg_grad)" />
|
|
33
|
+
<rect width="1600" height="1000" fill="url(#grid_pattern)" opacity="0.35" />
|
|
34
|
+
<rect width="1600" height="1000" fill="url(#highlight_grad)" />
|
|
35
|
+
|
|
36
|
+
<!-- Obsidian shards -->
|
|
37
|
+
<polygon points="120,80 360,40 420,140 180,210" fill="#0e1217" opacity="0.9" />
|
|
38
|
+
<polygon points="1320,90 1540,60 1580,200 1360,240" fill="#0e1217" opacity="0.85" />
|
|
39
|
+
<polygon points="420,820 640,760 720,900 480,950" fill="#0d1116" opacity="0.9" />
|
|
40
|
+
<polygon points="1080,760 1360,700 1460,860 1160,930" fill="#0d1116" opacity="0.85" />
|
|
41
|
+
|
|
42
|
+
<!-- Decorative gold rails -->
|
|
43
|
+
<path d="M 80 120 L 1520 120" stroke="url(#gold_grad)" stroke-width="2" opacity="0.7" />
|
|
44
|
+
<path d="M 80 900 L 1520 900" stroke="url(#gold_grad)" stroke-width="2" opacity="0.6" />
|
|
45
|
+
<path d="M 140 150 L 140 870" stroke="#3a3220" stroke-width="1" opacity="0.5" />
|
|
46
|
+
<path d="M 1460 150 L 1460 870" stroke="#3a3220" stroke-width="1" opacity="0.5" />
|
|
47
|
+
|
|
48
|
+
<!-- Title -->
|
|
49
|
+
<text x="120" y="95" fill="#e5d6a2" font-size="36" font-family="Trebuchet MS, Arial, sans-serif" letter-spacing="2">
|
|
50
|
+
JSGUI3-HTML IMPROVEMENT MAP
|
|
51
|
+
</text>
|
|
52
|
+
<text x="120" y="125" fill="#9aa1a8" font-size="16" font-family="Trebuchet MS, Arial, sans-serif" letter-spacing="1">
|
|
53
|
+
Industrial Luxury Obsidian theme | Control Expansion + Feature Depth
|
|
54
|
+
</text>
|
|
55
|
+
|
|
56
|
+
<!-- Central crest -->
|
|
57
|
+
<circle cx="800" cy="500" r="120" fill="url(#steel_grad)" stroke="url(#gold_grad)" stroke-width="3" filter="url(#soft_glow)" />
|
|
58
|
+
<circle cx="800" cy="500" r="90" fill="#0f141a" stroke="#2c3138" stroke-width="2" />
|
|
59
|
+
<text x="800" y="485" fill="#e5d6a2" font-size="22" font-family="Trebuchet MS, Arial, sans-serif" text-anchor="middle">
|
|
60
|
+
CONTROL SYSTEMS
|
|
61
|
+
</text>
|
|
62
|
+
<text x="800" y="515" fill="#9aa1a8" font-size="14" font-family="Trebuchet MS, Arial, sans-serif" text-anchor="middle">
|
|
63
|
+
themes | behavior | data
|
|
64
|
+
</text>
|
|
65
|
+
|
|
66
|
+
<!-- Panels -->
|
|
67
|
+
<g filter="url(#panel_shadow)">
|
|
68
|
+
<rect x="120" y="180" width="560" height="220" rx="18" fill="#11161c" stroke="#2c333b" stroke-width="2" />
|
|
69
|
+
<rect x="920" y="180" width="560" height="220" rx="18" fill="#11161c" stroke="#2c333b" stroke-width="2" />
|
|
70
|
+
<rect x="120" y="430" width="560" height="220" rx="18" fill="#11161c" stroke="#2c333b" stroke-width="2" />
|
|
71
|
+
<rect x="920" y="430" width="560" height="220" rx="18" fill="#11161c" stroke="#2c333b" stroke-width="2" />
|
|
72
|
+
<rect x="120" y="680" width="560" height="200" rx="18" fill="#11161c" stroke="#2c333b" stroke-width="2" />
|
|
73
|
+
<rect x="920" y="680" width="560" height="200" rx="18" fill="#11161c" stroke="#2c333b" stroke-width="2" />
|
|
74
|
+
</g>
|
|
75
|
+
|
|
76
|
+
<!-- Panel headings -->
|
|
77
|
+
<text x="160" y="220" fill="#e5d6a2" font-size="20" font-family="Trebuchet MS, Arial, sans-serif" letter-spacing="1">
|
|
78
|
+
CORE CONTROL EXPANSION
|
|
79
|
+
</text>
|
|
80
|
+
<text x="960" y="220" fill="#e5d6a2" font-size="20" font-family="Trebuchet MS, Arial, sans-serif" letter-spacing="1">
|
|
81
|
+
FORM AND EDITOR DEPTH
|
|
82
|
+
</text>
|
|
83
|
+
<text x="160" y="470" fill="#e5d6a2" font-size="20" font-family="Trebuchet MS, Arial, sans-serif" letter-spacing="1">
|
|
84
|
+
DATA AND COLLECTION
|
|
85
|
+
</text>
|
|
86
|
+
<text x="960" y="470" fill="#e5d6a2" font-size="20" font-family="Trebuchet MS, Arial, sans-serif" letter-spacing="1">
|
|
87
|
+
LAYOUT AND NAVIGATION
|
|
88
|
+
</text>
|
|
89
|
+
<text x="160" y="720" fill="#e5d6a2" font-size="20" font-family="Trebuchet MS, Arial, sans-serif" letter-spacing="1">
|
|
90
|
+
ACCESSIBILITY AND THEME
|
|
91
|
+
</text>
|
|
92
|
+
<text x="960" y="720" fill="#e5d6a2" font-size="20" font-family="Trebuchet MS, Arial, sans-serif" letter-spacing="1">
|
|
93
|
+
INFRA AND DX
|
|
94
|
+
</text>
|
|
95
|
+
|
|
96
|
+
<!-- Panel bullets -->
|
|
97
|
+
<g fill="#c3c8ce" font-size="14" font-family="Trebuchet MS, Arial, sans-serif">
|
|
98
|
+
<text x="160" y="252">- textarea, number, range, progress, meter</text>
|
|
99
|
+
<text x="160" y="274">- switch, badge, tooltip, toast, breadcrumb</text>
|
|
100
|
+
<text x="160" y="296">- chip input, pagination, notification banner</text>
|
|
101
|
+
<text x="160" y="318">- standard icon buttons and input masks</text>
|
|
102
|
+
|
|
103
|
+
<text x="960" y="252">- form container + validation hooks</text>
|
|
104
|
+
<text x="960" y="274">- field error display and status badges</text>
|
|
105
|
+
<text x="960" y="296">- object editor schema rendering</text>
|
|
106
|
+
<text x="960" y="318">- rich text toolbar + paste sanitization</text>
|
|
107
|
+
|
|
108
|
+
<text x="160" y="502">- data table with sort, filter, paginate</text>
|
|
109
|
+
<text x="160" y="524">- virtual list/grid for large data</text>
|
|
110
|
+
<text x="160" y="546">- tree-table hybrid + lazy load</text>
|
|
111
|
+
<text x="160" y="568">- reconnect modern data grid module</text>
|
|
112
|
+
|
|
113
|
+
<text x="960" y="502">- split panes + resizable layout</text>
|
|
114
|
+
<text x="960" y="524">- accordion, drawer, wizard stepper</text>
|
|
115
|
+
<text x="960" y="546">- tab variants + overflow handling</text>
|
|
116
|
+
<text x="960" y="568">- window snap, dock, z-order</text>
|
|
117
|
+
|
|
118
|
+
<text x="160" y="752">- ARIA roles and focus management</text>
|
|
119
|
+
<text x="160" y="774">- keyboard navigation standards</text>
|
|
120
|
+
<text x="160" y="796">- theming tokens + CSS variables</text>
|
|
121
|
+
<text x="160" y="818">- high contrast + reduced motion</text>
|
|
122
|
+
|
|
123
|
+
<text x="960" y="752">- normalize duplicate control names</text>
|
|
124
|
+
<text x="960" y="774">- stable public API surface</text>
|
|
125
|
+
<text x="960" y="796">- test harnesses + visual regressions</text>
|
|
126
|
+
<text x="960" y="818">- structured docs and sample gallery</text>
|
|
127
|
+
</g>
|
|
128
|
+
|
|
129
|
+
<!-- Connectors -->
|
|
130
|
+
<g stroke="#3b3f46" stroke-width="1" opacity="0.7">
|
|
131
|
+
<line x1="680" y1="290" x2="720" y2="410" />
|
|
132
|
+
<line x1="920" y1="290" x2="880" y2="410" />
|
|
133
|
+
<line x1="680" y1="540" x2="720" y2="540" />
|
|
134
|
+
<line x1="920" y1="540" x2="880" y2="540" />
|
|
135
|
+
<line x1="680" y1="790" x2="720" y2="600" />
|
|
136
|
+
<line x1="920" y1="790" x2="880" y2="600" />
|
|
137
|
+
</g>
|
|
138
|
+
|
|
139
|
+
<!-- Gold accents -->
|
|
140
|
+
<g stroke="url(#gold_grad)" stroke-width="2" opacity="0.8">
|
|
141
|
+
<line x1="120" y1="410" x2="680" y2="410" />
|
|
142
|
+
<line x1="920" y1="410" x2="1480" y2="410" />
|
|
143
|
+
<line x1="120" y1="660" x2="680" y2="660" />
|
|
144
|
+
<line x1="920" y1="660" x2="1480" y2="660" />
|
|
145
|
+
</g>
|
|
146
|
+
|
|
147
|
+
<!-- Footer note -->
|
|
148
|
+
<text x="120" y="950" fill="#7f8790" font-size="13" font-family="Trebuchet MS, Arial, sans-serif">
|
|
149
|
+
Diagram companion to docs/jsgui3-html-improvement-ideas.md
|
|
150
|
+
</text>
|
|
151
|
+
</svg>
|
|
@@ -149,19 +149,24 @@ class EarthGlobeRenderer {
|
|
|
149
149
|
enablePipeline() { this.pipelineEnabled = true; }
|
|
150
150
|
disablePipeline() { this.pipelineEnabled = false; }
|
|
151
151
|
setSunDirection(vec3) { this.sun = this._normVec(vec3); this.render(false); }
|
|
152
|
-
setSunFromSpherical(lonDeg, latDeg) {
|
|
153
|
-
// convenience API used by existing client code
|
|
154
|
-
const λ = lonDeg * Math.PI/180;
|
|
155
|
-
const φ = latDeg * Math.PI/180;
|
|
156
|
-
const cφ = Math.cos(φ);
|
|
157
|
-
this.setSunDirection([
|
|
158
|
-
cφ * Math.sin(λ),
|
|
159
|
-
Math.sin(φ),
|
|
160
|
-
cφ * Math.cos(λ)
|
|
161
|
-
]);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
152
|
+
setSunFromSpherical(lonDeg, latDeg) {
|
|
153
|
+
// convenience API used by existing client code
|
|
154
|
+
const λ = lonDeg * Math.PI/180;
|
|
155
|
+
const φ = latDeg * Math.PI/180;
|
|
156
|
+
const cφ = Math.cos(φ);
|
|
157
|
+
this.setSunDirection([
|
|
158
|
+
cφ * Math.sin(λ),
|
|
159
|
+
Math.sin(φ),
|
|
160
|
+
cφ * Math.cos(λ)
|
|
161
|
+
]);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
_update_rot() {
|
|
165
|
+
this.R = mat3FromQuat(this.q);
|
|
166
|
+
this.Rt = mat3Transpose(this.R);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
_buildContinents() {
|
|
165
170
|
const arr = [];
|
|
166
171
|
for (const name of Object.keys(CONTINENT_OUTLINES)) {
|
|
167
172
|
const def = CONTINENT_OUTLINES[name];
|
|
@@ -356,4 +361,4 @@ class EarthGlobeRenderer {
|
|
|
356
361
|
}
|
|
357
362
|
}
|
|
358
363
|
|
|
359
|
-
module.exports = EarthGlobeRenderer;
|
|
364
|
+
module.exports = EarthGlobeRenderer;
|
|
@@ -2,9 +2,9 @@ const BaseStage = require('./BaseStage');
|
|
|
2
2
|
|
|
3
3
|
class TransformStage extends BaseStage {
|
|
4
4
|
/** @param {RenderState} rs */
|
|
5
|
-
execute(rs) {
|
|
6
|
-
const r = this.r;
|
|
7
|
-
r.
|
|
5
|
+
execute(rs) {
|
|
6
|
+
const r = this.r;
|
|
7
|
+
r._update_rot();
|
|
8
8
|
|
|
9
9
|
const rect = r.canvas.getBoundingClientRect();
|
|
10
10
|
const width = rect.width || r.canvas.width / r.opts.dpr;
|
|
@@ -13,8 +13,8 @@ class TransformStage extends BaseStage {
|
|
|
13
13
|
rs.height = height;
|
|
14
14
|
|
|
15
15
|
const pad = r.opts.padding;
|
|
16
|
-
const
|
|
17
|
-
rs.radius = Math.max(1,
|
|
16
|
+
const min_side = Math.min(width, height);
|
|
17
|
+
rs.radius = Math.max(1, min_side / 2 - pad);
|
|
18
18
|
rs.cx = width * 0.5;
|
|
19
19
|
rs.cy = height * 0.5;
|
|
20
20
|
}
|