@oicl/openbridge-webcomponents-full-bundle 2.2.0-next.22 → 2.2.0-next.23
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/custom-elements-manifest.config.mjs +2 -1
- package/custom-elements.json +312 -17
- package/llms/components/obc-accordion-card.md +141 -0
- package/llms/components/obc-accordion-item.md +90 -0
- package/llms/components/obc-advice-button.md +87 -0
- package/llms/components/obc-advice-floating-item.md +113 -0
- package/llms/components/obc-advice-menu-item.md +87 -0
- package/llms/components/obc-advice-message-item.md +138 -0
- package/llms/components/obc-alert-button-item.md +117 -0
- package/llms/components/obc-alert-button.md +134 -0
- package/llms/components/obc-alert-counter-item.md +74 -0
- package/llms/components/obc-alert-detail-page.md +45 -0
- package/llms/components/obc-alert-floating-item.md +53 -0
- package/llms/components/obc-alert-frame.md +142 -0
- package/llms/components/obc-alert-icon.md +79 -0
- package/llms/components/obc-alert-list-details-experimental.md +89 -0
- package/llms/components/obc-alert-list-details.md +38 -0
- package/llms/components/obc-alert-list-page-small.md +39 -0
- package/llms/components/obc-alert-list.md +37 -0
- package/llms/components/obc-alert-menu-item.md +128 -0
- package/llms/components/obc-alert-menu.md +115 -0
- package/llms/components/obc-alert-subsystem-button.md +88 -0
- package/llms/components/obc-alert-subsystem-counter.md +110 -0
- package/llms/components/obc-analog-threeway-valve.md +106 -0
- package/llms/components/obc-analog-valve.md +74 -0
- package/llms/components/obc-app-button.md +83 -0
- package/llms/components/obc-app-menu.md +69 -0
- package/llms/components/obc-area-graph.md +333 -0
- package/llms/components/obc-attachment-list-item.md +49 -0
- package/llms/components/obc-audio-output.md +59 -0
- package/llms/components/obc-audio-recording-item.md +91 -0
- package/llms/components/obc-automation-badge.md +66 -0
- package/llms/components/obc-automation-button-readout-stack.md +71 -0
- package/llms/components/obc-automation-button.md +86 -0
- package/llms/components/obc-automation-input-modal.md +48 -0
- package/llms/components/obc-automation-readout.md +32 -0
- package/llms/components/obc-automation-tank.md +156 -0
- package/llms/components/obc-azimuth-thruster-labeled.md +56 -0
- package/llms/components/obc-azimuth-thruster.md +80 -0
- package/llms/components/obc-badge-command.md +26 -0
- package/llms/components/obc-badge.md +151 -0
- package/llms/components/obc-bar-horizontal.md +123 -0
- package/llms/components/obc-bar-vertical.md +125 -0
- package/llms/components/obc-battery-icon.md +38 -0
- package/llms/components/obc-bearing-indicator.md +27 -0
- package/llms/components/obc-bipolar-transistor.md +64 -0
- package/llms/components/obc-breadcrumb.md +58 -0
- package/llms/components/obc-brilliance-menu.md +115 -0
- package/llms/components/obc-bus.md +64 -0
- package/llms/components/obc-button.md +110 -0
- package/llms/components/obc-calendar.md +91 -0
- package/llms/components/obc-capacitor.md +64 -0
- package/llms/components/obc-card.md +103 -0
- package/llms/components/obc-chart-object-vessel-button.md +103 -0
- package/llms/components/obc-chat-message.md +35 -0
- package/llms/components/obc-check-button.md +104 -0
- package/llms/components/obc-checkbox-item.md +95 -0
- package/llms/components/obc-checkbox-list.md +73 -0
- package/llms/components/obc-checkbox.md +97 -0
- package/llms/components/obc-circular-progress.md +36 -0
- package/llms/components/obc-clock.md +86 -0
- package/llms/components/obc-command-button.md +56 -0
- package/llms/components/obc-command-menu.md +135 -0
- package/llms/components/obc-communication-table.md +31 -0
- package/llms/components/obc-compass-flat.md +79 -0
- package/llms/components/obc-compass-indicator.md +61 -0
- package/llms/components/obc-compass-sector.md +110 -0
- package/llms/components/obc-compass.md +157 -0
- package/llms/components/obc-context-menu-input.md +191 -0
- package/llms/components/obc-converter.md +64 -0
- package/llms/components/obc-corner-line.md +29 -0
- package/llms/components/obc-current.md +79 -0
- package/llms/components/obc-damper.md +62 -0
- package/llms/components/obc-date-item.md +66 -0
- package/llms/components/obc-depth-actual.md +69 -0
- package/llms/components/obc-depth-indicator.md +31 -0
- package/llms/components/obc-depth-top-band.md +43 -0
- package/llms/components/obc-depth.md +94 -0
- package/llms/components/obc-diagnostic-button.md +71 -0
- package/llms/components/obc-diagnostic-menu.md +88 -0
- package/llms/components/obc-digital-threeway-valve.md +112 -0
- package/llms/components/obc-digital-valve.md +78 -0
- package/llms/components/obc-diodes.md +64 -0
- package/llms/components/obc-direction-line.md +28 -0
- package/llms/components/obc-divider.md +44 -0
- package/llms/components/obc-donut-chart.md +116 -0
- package/llms/components/obc-draft-trim.md +67 -0
- package/llms/components/obc-dropdown-button.md +99 -0
- package/llms/components/obc-electricity-battery.md +83 -0
- package/llms/components/obc-elevated-card-radio-group.md +103 -0
- package/llms/components/obc-elevated-card-radio.md +104 -0
- package/llms/components/obc-elevated-card.md +146 -0
- package/llms/components/obc-end-point-line.md +29 -0
- package/llms/components/obc-event-item.md +47 -0
- package/llms/components/obc-event-list.md +37 -0
- package/llms/components/obc-fan.md +68 -0
- package/llms/components/obc-filter-chip.md +91 -0
- package/llms/components/obc-filter.md +64 -0
- package/llms/components/obc-floating-item.md +125 -0
- package/llms/components/obc-form-container.md +45 -0
- package/llms/components/obc-form-footer-container.md +34 -0
- package/llms/components/obc-form-group.md +80 -0
- package/llms/components/obc-form-item.md +95 -0
- package/llms/components/obc-gauge-bar-indicator.md +46 -0
- package/llms/components/obc-gauge-generator.md +102 -0
- package/llms/components/obc-gauge-horizontal.md +169 -0
- package/llms/components/obc-gauge-motors-and-pumps.md +110 -0
- package/llms/components/obc-gauge-proportional.md +134 -0
- package/llms/components/obc-gauge-radial-indicator.md +76 -0
- package/llms/components/obc-gauge-radial.md +163 -0
- package/llms/components/obc-gauge-trend-indicator.md +53 -0
- package/llms/components/obc-gauge-trend.md +271 -0
- package/llms/components/obc-gauge-valve.md +114 -0
- package/llms/components/obc-gauge-vertical.md +169 -0
- package/llms/components/obc-gnss-skyplot.md +80 -0
- package/llms/components/obc-graph-mini.md +28 -0
- package/llms/components/obc-ground.md +64 -0
- package/llms/components/obc-heading-indicator.md +42 -0
- package/llms/components/obc-heading.md +106 -0
- package/llms/components/obc-heat-exchanger.md +80 -0
- package/llms/components/obc-heat-pump.md +79 -0
- package/llms/components/obc-heave-indicator.md +38 -0
- package/llms/components/obc-heave.md +60 -0
- package/llms/components/obc-horizontal-line.md +29 -0
- package/llms/components/obc-hydraulic-check-valve.md +36 -0
- package/llms/components/obc-hydraulic-separator.md +80 -0
- package/llms/components/obc-hydraulic-valve-4-3.md +71 -0
- package/llms/components/obc-hydraulic-valve-x-2.md +68 -0
- package/llms/components/obc-icon-button.md +117 -0
- package/llms/components/obc-icon-check-button.md +85 -0
- package/llms/components/obc-indicator-battery.md +69 -0
- package/llms/components/obc-indicator-engine.md +39 -0
- package/llms/components/obc-indicator-generator.md +59 -0
- package/llms/components/obc-indicator-graph.md +33 -0
- package/llms/components/obc-indicator-tank-atmospheric.md +69 -0
- package/llms/components/obc-input-chip.md +96 -0
- package/llms/components/obc-instrument-field.md +172 -0
- package/llms/components/obc-instrument-radial.md +77 -0
- package/llms/components/obc-integration-app-bar.md +41 -0
- package/llms/components/obc-integration-bar-dropdown.md +71 -0
- package/llms/components/obc-integration-bar.md +72 -0
- package/llms/components/obc-integration-button.md +62 -0
- package/llms/components/obc-integration-dropdown-button.md +75 -0
- package/llms/components/obc-integration-fleet-button.md +41 -0
- package/llms/components/obc-integration-tabs.md +28 -0
- package/llms/components/obc-integration-vessel-menu.md +58 -0
- package/llms/components/obc-integration-vessel-selector.md +32 -0
- package/llms/components/obc-keyboard-full.md +175 -0
- package/llms/components/obc-keyboard-numeric.md +77 -0
- package/llms/components/obc-line-cross.md +28 -0
- package/llms/components/obc-line-graph.md +164 -0
- package/llms/components/obc-line-overlap.md +28 -0
- package/llms/components/obc-logic.md +64 -0
- package/llms/components/obc-main-engine-indicator.md +55 -0
- package/llms/components/obc-main-engine.md +54 -0
- package/llms/components/obc-menu-button.md +158 -0
- package/llms/components/obc-message-menu-item.md +165 -0
- package/llms/components/obc-modal-window.md +139 -0
- package/llms/components/obc-mosfet.md +64 -0
- package/llms/components/obc-motor.md +73 -0
- package/llms/components/obc-navigation-item-group.md +82 -0
- package/llms/components/obc-navigation-item.md +138 -0
- package/llms/components/obc-navigation-menu.md +135 -0
- package/llms/components/obc-non-return-valve.md +79 -0
- package/llms/components/obc-notification-badge-button.md +87 -0
- package/llms/components/obc-notification-button.md +92 -0
- package/llms/components/obc-notification-floating-item.md +121 -0
- package/llms/components/obc-notification-menu-item.md +87 -0
- package/llms/components/obc-notification-message-item.md +127 -0
- package/llms/components/obc-number-input-field.md +97 -0
- package/llms/components/obc-pagination.md +95 -0
- package/llms/components/obc-pie-chart.md +120 -0
- package/llms/components/obc-pitch-indicator.md +39 -0
- package/llms/components/obc-pitch-roll-heave.md +86 -0
- package/llms/components/obc-pitch-roll-yaw.md +72 -0
- package/llms/components/obc-pitch-roll.md +63 -0
- package/llms/components/obc-pitch.md +81 -0
- package/llms/components/obc-pivot-item-group.md +79 -0
- package/llms/components/obc-pivot-item.md +75 -0
- package/llms/components/obc-poi-aton.md +68 -0
- package/llms/components/obc-poi-button-aton.md +54 -0
- package/llms/components/obc-poi-button-data.md +53 -0
- package/llms/components/obc-poi-button-vessel.md +55 -0
- package/llms/components/obc-poi-button.md +94 -0
- package/llms/components/obc-poi-card-header.md +90 -0
- package/llms/components/obc-poi-card.md +110 -0
- package/llms/components/obc-poi-controller.md +151 -0
- package/llms/components/obc-poi-data.md +72 -0
- package/llms/components/obc-poi-graphic-line.md +70 -0
- package/llms/components/obc-poi-group.md +85 -0
- package/llms/components/obc-poi-header.md +71 -0
- package/llms/components/obc-poi-layer-stack.md +85 -0
- package/llms/components/obc-poi-layer.md +110 -0
- package/llms/components/obc-poi-line.md +70 -0
- package/llms/components/obc-poi-object-aton.md +45 -0
- package/llms/components/obc-poi-object-data.md +48 -0
- package/llms/components/obc-poi-object-vessel.md +95 -0
- package/llms/components/obc-poi-object.md +82 -0
- package/llms/components/obc-poi-pointer.md +70 -0
- package/llms/components/obc-poi-selection-frame.md +66 -0
- package/llms/components/obc-poi-vessel.md +70 -0
- package/llms/components/obc-poi.md +140 -0
- package/llms/components/obc-polar-chart.md +126 -0
- package/llms/components/obc-position-deviation.md +84 -0
- package/llms/components/obc-pressure-reduction-valve.md +88 -0
- package/llms/components/obc-pressure-sustain-valve.md +85 -0
- package/llms/components/obc-progress-bar.md +102 -0
- package/llms/components/obc-progress-button.md +111 -0
- package/llms/components/obc-progress-indicator-dots.md +57 -0
- package/llms/components/obc-propulsion-azimuth-indicator.md +48 -0
- package/llms/components/obc-pump.md +76 -0
- package/llms/components/obc-radial-bar-chart.md +103 -0
- package/llms/components/obc-radio.md +82 -0
- package/llms/components/obc-rate-of-turn.md +95 -0
- package/llms/components/obc-readout-block.md +137 -0
- package/llms/components/obc-readout-list-item.md +142 -0
- package/llms/components/obc-readout-list.md +85 -0
- package/llms/components/obc-readout.md +169 -0
- package/llms/components/obc-resistor.md +64 -0
- package/llms/components/obc-rich-button.md +92 -0
- package/llms/components/obc-roll-indicator.md +38 -0
- package/llms/components/obc-roll.md +56 -0
- package/llms/components/obc-rot-indicator.md +32 -0
- package/llms/components/obc-rot-linear.md +68 -0
- package/llms/components/obc-rot-sector.md +125 -0
- package/llms/components/obc-router.md +64 -0
- package/llms/components/obc-rudder-indicator.md +54 -0
- package/llms/components/obc-rudder.md +112 -0
- package/llms/components/obc-ruler-pointer.md +57 -0
- package/llms/components/obc-scrollbar.md +57 -0
- package/llms/components/obc-sequence-card.md +119 -0
- package/llms/components/obc-sequence-connector.md +70 -0
- package/llms/components/obc-sequence-item.md +64 -0
- package/llms/components/obc-sequence-loading-spinner.md +70 -0
- package/llms/components/obc-sequence-modal.md +89 -0
- package/llms/components/obc-sequence-step.md +48 -0
- package/llms/components/obc-sequence-toolbar.md +108 -0
- package/llms/components/obc-slide-button.md +111 -0
- package/llms/components/obc-slider-double.md +137 -0
- package/llms/components/obc-slider.md +143 -0
- package/llms/components/obc-source.md +64 -0
- package/llms/components/obc-speed-arrows.md +39 -0
- package/llms/components/obc-speed-directions.md +66 -0
- package/llms/components/obc-speed-gauge.md +124 -0
- package/llms/components/obc-speed-indicator.md +37 -0
- package/llms/components/obc-split-button.md +144 -0
- package/llms/components/obc-start-stop-switch.md +126 -0
- package/llms/components/obc-status-indicator.md +30 -0
- package/llms/components/obc-stepper-box.md +90 -0
- package/llms/components/obc-surge-sway-yaw.md +95 -0
- package/llms/components/obc-switch.md +69 -0
- package/llms/components/obc-system-button.md +112 -0
- package/llms/components/obc-system-menu.md +67 -0
- package/llms/components/obc-tab-item.md +161 -0
- package/llms/components/obc-tab-row.md +151 -0
- package/llms/components/obc-tabbed-card.md +148 -0
- package/llms/components/obc-table-header-item.md +42 -0
- package/llms/components/obc-table.md +124 -0
- package/llms/components/obc-tag.md +41 -0
- package/llms/components/obc-text-input-field.md +94 -0
- package/llms/components/obc-textarea-field.md +186 -0
- package/llms/components/obc-textbox.md +80 -0
- package/llms/components/obc-three-way-line.md +29 -0
- package/llms/components/obc-thruster.md +64 -0
- package/llms/components/obc-title-container.md +81 -0
- package/llms/components/obc-toggle-button-group.md +184 -0
- package/llms/components/obc-toggle-button-option.md +126 -0
- package/llms/components/obc-toggle-button-three-state.md +38 -0
- package/llms/components/obc-toggle-button-vertical-group.md +142 -0
- package/llms/components/obc-toggle-button-vertical-option.md +110 -0
- package/llms/components/obc-toggle-switch.md +126 -0
- package/llms/components/obc-toggletip.md +135 -0
- package/llms/components/obc-tooltip.md +106 -0
- package/llms/components/obc-top-bar.md +194 -0
- package/llms/components/obc-top-view-propulsion.md +84 -0
- package/llms/components/obc-topbar-message-item.md +150 -0
- package/llms/components/obc-transformer.md +64 -0
- package/llms/components/obc-transmitter-button.md +101 -0
- package/llms/components/obc-transmitter-stack.md +79 -0
- package/llms/components/obc-transmitter.md +114 -0
- package/llms/components/obc-tree-navigation-group.md +69 -0
- package/llms/components/obc-tree-navigation-item.md +110 -0
- package/llms/components/obc-tree-navigation.md +73 -0
- package/llms/components/obc-tunnel-thruster.md +59 -0
- package/llms/components/obc-user-button.md +107 -0
- package/llms/components/obc-user-menu.md +154 -0
- package/llms/components/obc-valve-analog-three-way-icon.md +69 -0
- package/llms/components/obc-valve-analog-two-way-icon.md +39 -0
- package/llms/components/obc-velocity-projection-plot.md +34 -0
- package/llms/components/obc-vendor-button.md +63 -0
- package/llms/components/obc-vertical-line.md +33 -0
- package/llms/components/obc-watch-flat.md +54 -0
- package/llms/components/obc-watch.md +206 -0
- package/llms/components/obc-wind-indicator.md +52 -0
- package/llms/components/obc-wind-propulsion.md +92 -0
- package/llms/components/obc-wind.md +46 -0
- package/llms/docs/ar-poi-projection.md +36 -0
- package/llms/docs/automation-sequence-step-diagram-playground.md +13 -0
- package/llms/docs/building-blocks-advice.md +31 -0
- package/llms/docs/building-blocks-external-scale.md +138 -0
- package/llms/docs/building-blocks-setpoint.md +119 -0
- package/llms/docs/introduction-advice-system.md +161 -0
- package/llms/docs/introduction-getting-started.md +94 -0
- package/llms/docs/introduction-introduction.md +27 -0
- package/llms/docs/introduction-join-the-project.md +11 -0
- package/llms/docs/introduction-migration-guide-2-0-to-2-1.md +126 -0
- package/llms/docs/introduction-migration-guide-2-1-to-2-2.md +106 -0
- package/llms/docs/introduction-migration-guide.md +1063 -0
- package/llms/docs/palettes-categorical-colour.md +9 -0
- package/llms/llms-full.txt +28380 -0
- package/llms/llms.txt +368 -0
- package/package.json +12 -2
- package/script/cem-plugins/lifecycle.d.mts +6 -0
- package/script/cem-plugins/lifecycle.mjs +48 -0
- package/script/cem-plugins.test.ts +52 -1
- package/script/generate-llms-txt.ts +34 -0
- package/script/llms/channel.test.ts +69 -0
- package/script/llms/channel.ts +63 -0
- package/script/llms/generate.test.ts +143 -0
- package/script/llms/generate.ts +229 -0
- package/script/llms/manifest.test.ts +160 -0
- package/script/llms/manifest.ts +109 -0
- package/script/llms/markdown.test.ts +22 -0
- package/script/llms/markdown.ts +37 -0
- package/script/llms/mdx.test.ts +172 -0
- package/script/llms/mdx.ts +171 -0
- package/script/llms/render-component.test.ts +290 -0
- package/script/llms/render-component.ts +208 -0
- package/script/llms/render-guides.test.ts +105 -0
- package/script/llms/render-guides.ts +51 -0
- package/script/llms/render-llms-txt.test.ts +222 -0
- package/script/llms/render-llms-txt.ts +185 -0
- package/script/llms/sources.test.ts +118 -0
- package/script/llms/sources.ts +89 -0
- package/script/llms/stories.test.ts +193 -0
- package/script/llms/stories.ts +256 -0
- package/script/llms/types.ts +95 -0
- package/script/prepare-full-bundle.ts +1 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Advice
|
|
2
|
+
|
|
3
|
+
[Storybook](https://openbridge-next-storybook.web.app/?path=/docs/building-blocks-advice--docs)
|
|
4
|
+
|
|
5
|
+
## Advice
|
|
6
|
+
|
|
7
|
+
An advice is a range (`min`/`max`) or a point (`value`) on an instrument's
|
|
8
|
+
scale that the operator should steer into (**go-to**: `optimal`, `running`,
|
|
9
|
+
`eco`) or stay out of (**no-go**: `caution`, `warning`, `alarm`,
|
|
10
|
+
`exclusion`). Every instrument takes the same `advices` list and resolves it
|
|
11
|
+
against its readings: the band turns `triggered` while a reading sits inside
|
|
12
|
+
it. `adviceTrigger` picks the readings (`both`, `value`, `setpoint`);
|
|
13
|
+
`adviceEmphasis` applies the design's resting rule — go-to bands `active`,
|
|
14
|
+
no-go bands `enabled`, and a hit on one group fades the other to `hinted`.
|
|
15
|
+
|
|
16
|
+
Advices are temporary: an application shows them while an assistance mode is
|
|
17
|
+
on and clears the list afterwards. See the *Advice System* page under
|
|
18
|
+
Introduction for the vocabulary, the tokens and the migration from the
|
|
19
|
+
instrument-specific shapes.
|
|
20
|
+
|
|
21
|
+
Source: `packages/openbridge-webcomponents/src/svghelpers/advice.ts`
|
|
22
|
+
|
|
23
|
+
## Stories
|
|
24
|
+
|
|
25
|
+
- [Playground](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-advice--playground)
|
|
26
|
+
- [Visual State Comparison](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-advice--advice-comparison): Every category in every state on the linear scale. The reading sits outside the band, so each cell shows the configured state; `triggered` is what a hit turns the band into.
|
|
27
|
+
- [Visual State Comparison (Radial)](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-advice--advice-comparison-radial): The same matrix on the watch face. Caution hatches, exclusion hairlines, and the alert outline on a triggered warning or alarm are the radial counterparts of the linear patterns.
|
|
28
|
+
- [State Change Flow](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-advice--advice-state-change-flow): A value moving through the bands with `adviceEmphasis` on: at rest the go-to band is `active` and the no-go band `enabled`; entering the optimal band triggers it and fades the caution band to `hinted`; entering the caution band does the reverse. The linear and the radial rendering share the resolution.
|
|
29
|
+
- [Resolution Stack (Radial)](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-advice--advice-resolution-stack): Chained bands resolved against three readings. Bands that meet are cut flat at the join; a hit on one group fades the other group to `hinted`, while an unhit band of the hit group keeps its resting state.
|
|
30
|
+
- [Range and Point](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-advice--advice-range-and-point): A range and a point on a horizontal bar, with the area layer on two of them: the tint and the dotted limits of the optimal range, the dashed line of the caution point. The point is a dot on the tick base; an alert point is a short tick instead.
|
|
31
|
+
- [Icons](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-advice--advice-icons): Every category with its icon, at rest and triggered, on the bar and on the radial gauge. The icon sits in the label column, centred on the band; a triggered alert category switches to its IEC icon with that icon's own colours, a go-to category keeps its outline in the band's colour.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# External Scale
|
|
2
|
+
|
|
3
|
+
[Storybook](https://openbridge-next-storybook.web.app/?path=/docs/building-blocks-external-scale--docs)
|
|
4
|
+
|
|
5
|
+
## External Scale renderer (pure SVG building block)
|
|
6
|
+
|
|
7
|
+
This module provides a side-aware, orientation-aware SVG “ruler/axis” renderer that can be used standalone, as an overlay axis for charts, or composed inside other components.
|
|
8
|
+
|
|
9
|
+
Unlike Lit components, this file exports **pure functions** that return `SVGTemplateResult` fragments. Consumers are responsible for creating the outer `<svg>` element (including `viewBox`, sizing, and `preserveAspectRatio`).
|
|
10
|
+
|
|
11
|
+
The module also exports a few small DOM helpers the web-component wrappers use to read CSS variables (border radius) and observe theme and size changes.
|
|
12
|
+
|
|
13
|
+
### What it renders
|
|
14
|
+
- **Bar container**: a rounded rectangle band (optional)
|
|
15
|
+
- **Bar fill**: value fill (0→value) or tinted range fill (fillMin→fillMax)
|
|
16
|
+
- **Tickmarks**: main + primary + secondary + tertiary tick lines (optional)
|
|
17
|
+
- **Labels**: numeric labels at primary tick interval (optional)
|
|
18
|
+
- **Advice overlays**: alert/advice/caution ranges with canonical dashed bounds
|
|
19
|
+
- **Setpoint marker**: a triangular marker that flips by side and scales when “at setpoint”
|
|
20
|
+
|
|
21
|
+
### Layout model
|
|
22
|
+
- `orientation`: `'vertical' | 'horizontal'` controls value→coordinate mapping
|
|
23
|
+
- `reverse`: plots `minValue` at the top / right, for quantities measured downward
|
|
24
|
+
- `side`: where the scale attaches to the chart edge
|
|
25
|
+
- vertical: `'left' | 'right'`
|
|
26
|
+
- horizontal: `'top' | 'bottom'`
|
|
27
|
+
- The **chart edge is always at perpendicular coordinate `0`**. The scale expands outward into positive or negative perpendicular space depending on `side`.
|
|
28
|
+
|
|
29
|
+
Use `computeExternalScaleLayout()` to compute the minimal viewBox thickness for the selected bands (bar/ticks/labels).
|
|
30
|
+
|
|
31
|
+
### Theming & responsive sizing
|
|
32
|
+
This renderer uses CSS variables directly in SVG attributes.
|
|
33
|
+
|
|
34
|
+
It is designed to inherit theme and sizing variables from parent containers (e.g. `.obc-component-size-*` wrappers) the same way web components do.
|
|
35
|
+
|
|
36
|
+
Common variables involved:
|
|
37
|
+
- `--global-typography-ui-label-font-size`
|
|
38
|
+
- `--instrument-frame-*-color`, `--instrument-*-*-color`
|
|
39
|
+
- `--instrument-components-watchface-frame-regular-border-radius`
|
|
40
|
+
|
|
41
|
+
**Browser note (SVG geometry + CSS variables):**
|
|
42
|
+
Some browsers (notably Chrome) do not reliably resolve `var(--...)` inside SVG geometry attributes like `rx`/`ry`. The bar container and fill masks therefore provide numeric fallbacks and also set `rx`/`ry` via CSS geometry properties to allow theme overrides where supported.
|
|
43
|
+
|
|
44
|
+
### Usage examples
|
|
45
|
+
|
|
46
|
+
#### Standalone usage
|
|
47
|
+
```ts
|
|
48
|
+
import {html} from 'lit';
|
|
49
|
+
import {
|
|
50
|
+
computeExternalScaleLayout,
|
|
51
|
+
renderExternalScale,
|
|
52
|
+
ExternalScaleOrientation,
|
|
53
|
+
ExternalScaleSide,
|
|
54
|
+
ScaleType,
|
|
55
|
+
FillMode,
|
|
56
|
+
AdvicePosition,
|
|
57
|
+
type ExternalScaleConfig,
|
|
58
|
+
} from './external-scale.js';
|
|
59
|
+
import {FrameStyle, InstrumentState, Priority} from '../../navigation-instruments/types.js';
|
|
60
|
+
|
|
61
|
+
const config: ExternalScaleConfig = {
|
|
62
|
+
orientation: ExternalScaleOrientation.vertical,
|
|
63
|
+
side: ExternalScaleSide.right,
|
|
64
|
+
length: 320,
|
|
65
|
+
paddingStart: 32,
|
|
66
|
+
paddingEnd: 32,
|
|
67
|
+
minValue: 0,
|
|
68
|
+
maxValue: 100,
|
|
69
|
+
hasBar: true,
|
|
70
|
+
hasScale: true,
|
|
71
|
+
labels: true,
|
|
72
|
+
scaleBackground: false,
|
|
73
|
+
barThickness: 24,
|
|
74
|
+
tickThickness: 24,
|
|
75
|
+
labelThickness: 60,
|
|
76
|
+
mainTickmarks: [],
|
|
77
|
+
primaryTickmarkInterval: 20,
|
|
78
|
+
secondaryTickmarkInterval: 10,
|
|
79
|
+
tertiaryTickmarkInterval: 2,
|
|
80
|
+
scaleType: ScaleType.regular,
|
|
81
|
+
frameStyle: FrameStyle.regular,
|
|
82
|
+
priority: Priority.enhanced,
|
|
83
|
+
fillMode: FillMode.fill,
|
|
84
|
+
fillMin: 0,
|
|
85
|
+
fillMax: 40,
|
|
86
|
+
value: 40,
|
|
87
|
+
setpoint: 50,
|
|
88
|
+
atSetpoint: false,
|
|
89
|
+
autoAtSetpoint: true,
|
|
90
|
+
autoAtSetpointDeadband: 1,
|
|
91
|
+
setpointAtZeroDeadband: 0.5,
|
|
92
|
+
state: InstrumentState.active,
|
|
93
|
+
advicePosition: AdvicePosition.inner,
|
|
94
|
+
advices: [{min: 60, max: 80, category: 'caution', state: 'hinted'}],
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const layout = computeExternalScaleLayout(config);
|
|
98
|
+
const parts = renderExternalScale(config);
|
|
99
|
+
|
|
100
|
+
// Wrap returned fragments in an SVG.
|
|
101
|
+
const tpl = html`<svg
|
|
102
|
+
width="${layout.viewBoxThickness}px"
|
|
103
|
+
height="${config.length}px"
|
|
104
|
+
viewBox="${layout.viewBoxPerpStart} ${-config.length / 2} ${layout.viewBoxThickness} ${config.length}"
|
|
105
|
+
preserveAspectRatio="none"
|
|
106
|
+
>
|
|
107
|
+
${parts.barContainer}
|
|
108
|
+
${parts.barFill}
|
|
109
|
+
${parts.scaleBackground}
|
|
110
|
+
${parts.tickmarks}
|
|
111
|
+
${parts.labels}
|
|
112
|
+
${parts.adviceOverlays}
|
|
113
|
+
${parts.setpoint}
|
|
114
|
+
</svg>`;
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
#### Web component wrappers
|
|
118
|
+
For common usage, prefer the thin wrappers:
|
|
119
|
+
- `obc-bar-vertical` (sets up vertical viewBox)
|
|
120
|
+
- `obc-bar-horizontal` (sets up horizontal viewBox)
|
|
121
|
+
|
|
122
|
+
Source of truth: `packages/openbridge-webcomponents/src/building-blocks/external-scale/external-scale.ts`
|
|
123
|
+
|
|
124
|
+
## Stories
|
|
125
|
+
|
|
126
|
+
- [Vertical (right side, hasBar, advices, setpoint)](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-external-scale--vertical-right-basic)
|
|
127
|
+
- [Vertical (with highlightCurrentValue dot)](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-external-scale--vertical-with-current-value-dot)
|
|
128
|
+
- [Vertical (left side, hasBar, advices, setpoint, fillMode:tint)](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-external-scale--vertical-left-tint)
|
|
129
|
+
- [Horizontal (bottom side, hasBar, advices, setpoint)](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-external-scale--horizontal-bottom-basic)
|
|
130
|
+
- [Horizontal (top side, hasBar, advices, setpoint, fillMode:tint)](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-external-scale--horizontal-top-tint)
|
|
131
|
+
- [Vertical (right side, scaleBackground=true)](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-external-scale--vertical-right-scale-background)
|
|
132
|
+
- [Fixed Aspect Ratio Comparison](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-external-scale--fixed-aspect-ratio-comparison): When `fixedAspectRatio=true`, the component scales proportionally (like CSS transform:scale) based on container size, while keeping label font-size constant.
|
|
133
|
+
|
|
134
|
+
- **false (default)**: Dimensions react to component properties
|
|
135
|
+
- **true**: "Freezes" internal calculations and scales the entire component as a vector
|
|
136
|
+
|
|
137
|
+
This story demonstrates both modes side-by-side with resizable containers using
|
|
138
|
+
the pure function renderer.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Setpoint
|
|
2
|
+
|
|
3
|
+
[Storybook](https://openbridge-next-storybook.web.app/?path=/docs/building-blocks-setpoint--docs)
|
|
4
|
+
|
|
5
|
+
## Setpoint Marker Visual States
|
|
6
|
+
|
|
7
|
+
The setpoint marker is a triangular indicator used to show the target/input value on instruments.
|
|
8
|
+
|
|
9
|
+
### Visual States
|
|
10
|
+
|
|
11
|
+
- **notEqual**: Value has not reached setpoint - full size, filled triangle
|
|
12
|
+
- **equal**: Value equals setpoint (within deadband) - 80% size, filled triangle
|
|
13
|
+
- **equalZero**: Both value and setpoint are at zero - 80% size + 8px outward offset
|
|
14
|
+
- **focus**: User is actively adjusting - full size, filled with tertiary color and 2px border
|
|
15
|
+
|
|
16
|
+
### Color Modes
|
|
17
|
+
|
|
18
|
+
Each state can be rendered in two color palettes:
|
|
19
|
+
- **Regular**: For non-priority states
|
|
20
|
+
- **Enhanced**: For in-command/priority states (brighter colors)
|
|
21
|
+
|
|
22
|
+
### Disabled State
|
|
23
|
+
|
|
24
|
+
Disabled is a separate boolean flag (not a color mode):
|
|
25
|
+
- Auto-derived from `InstrumentState.loading` or `InstrumentState.off`
|
|
26
|
+
- Uses tertiary/gray color regardless of color mode
|
|
27
|
+
- Can be manually overridden
|
|
28
|
+
|
|
29
|
+
Source: `packages/openbridge-webcomponents/src/svghelpers/setpoint.ts`
|
|
30
|
+
|
|
31
|
+
## Stories
|
|
32
|
+
|
|
33
|
+
- [NotEqual (Input ≠ Output)](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-setpoint--not-equal): **notEqual** - Input ≠ Output
|
|
34
|
+
|
|
35
|
+
The setpoint marker is at full size (100%) when the current value
|
|
36
|
+
has not yet reached the setpoint.
|
|
37
|
+
|
|
38
|
+
Use the controls to adjust value, setpoint, enhanced mode, etc.
|
|
39
|
+
- [Equal (Input = Output)](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-setpoint--equal): **equal** - Input = Output
|
|
40
|
+
|
|
41
|
+
The setpoint marker shrinks to 80% size when the current value
|
|
42
|
+
equals the setpoint (within the deadband tolerance).
|
|
43
|
+
|
|
44
|
+
Use the controls to adjust value, setpoint, enhanced mode, etc.
|
|
45
|
+
- [EqualZero (Input = Output = 0)](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-setpoint--equal-zero): **equalZero** - Input = Output = 0
|
|
46
|
+
|
|
47
|
+
When both value and setpoint are at zero, the marker shrinks to 80%
|
|
48
|
+
AND shifts 8px outward from the scale to avoid overlapping with
|
|
49
|
+
the zero position indicator.
|
|
50
|
+
|
|
51
|
+
Use the controls to adjust value, setpoint, enhanced mode, etc.
|
|
52
|
+
- [Focus (User adjusting)](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-setpoint--focus): **focus** - User is actively adjusting (dual-marker mode)
|
|
53
|
+
|
|
54
|
+
When the user is actively adjusting the setpoint (e.g., dragging),
|
|
55
|
+
setting `newSetpoint` triggers dual-marker mode:
|
|
56
|
+
- Original setpoint is dimmed (0.75 opacity)
|
|
57
|
+
- New setpoint shows in focus state (filled with border)
|
|
58
|
+
|
|
59
|
+
Use the controls to adjust value, setpoint, newSetpoint, etc.
|
|
60
|
+
- [Visual State Comparison](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-setpoint--setpoint-comparison): **Visual State Comparison**
|
|
61
|
+
|
|
62
|
+
Side-by-side comparison of all setpoint visual states for linear instruments (bar-vertical).
|
|
63
|
+
|
|
64
|
+
- **Row 1**: regular — Priority.regular color palette
|
|
65
|
+
- **Row 2**: enhanced — Priority.enhanced color palette
|
|
66
|
+
- **Row 3**: focus — touching=true (no newSetpoint), marker in focus visual state
|
|
67
|
+
- **Row 4**: newSetpoint — dual-marker mode via `newSetpoint` (original dimmed, new in focus)
|
|
68
|
+
- **Row 5**: disabled — InstrumentState.off, tertiary/gray colors
|
|
69
|
+
- [Visual State Comparison (Radial)](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-setpoint--setpoint-comparison-radial): Side-by-side comparison of all setpoint visual states for radial instruments (watch).
|
|
70
|
+
|
|
71
|
+
Visual state mapping:
|
|
72
|
+
- **notEqual**: bar at 45°, setpoint at 60° (different positions)
|
|
73
|
+
- **equal**: bar at 45°, setpoint at 45° (same position, atSetpoint=true)
|
|
74
|
+
- **equalZero**: bar at 0°, setpoint at 0° (both at zero, auto-derived)
|
|
75
|
+
|
|
76
|
+
Row mapping:
|
|
77
|
+
- **regular**: Priority.regular color palette
|
|
78
|
+
- **enhanced**: Priority.enhanced color palette
|
|
79
|
+
- **focus**: touching=true (no newAngleSetpoint) — marker in focus visual state
|
|
80
|
+
- **newSetpoint**: dual-marker mode via newAngleSetpoint (original dimmed, new in focus)
|
|
81
|
+
- **disabled**: InstrumentState.off — tertiary/gray colors
|
|
82
|
+
- [Setpoint Adjustment Flow (interactive)](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-setpoint--setpoint-adjustment-flow): **Setpoint Adjustment Flow** - Interactive demo showing setpoint adjustment UX
|
|
83
|
+
|
|
84
|
+
This story demonstrates the complete setpoint adjustment workflow:
|
|
85
|
+
|
|
86
|
+
1. **t=0 (At setpoint)**: Bar is filled to 40, setpoint is at 40 (equal state - 80% size)
|
|
87
|
+
2. **t=1 (Initiate adjustment)**: User starts adjusting, newSetpoint appears at same position
|
|
88
|
+
3. **t=2 (Move new setpoint)**: newSetpoint moves to 80, original setpoint stays dimmed at 40
|
|
89
|
+
4. **t=3 (Confirm)**: newSetpoint confirmed, bar animates to 80, original setpoint moves to 80
|
|
90
|
+
|
|
91
|
+
The `newSetpoint` property enables showing both current and proposed setpoint positions
|
|
92
|
+
simultaneously, with the original dimmed (0.75 opacity) while adjusting.
|
|
93
|
+
|
|
94
|
+
Tertiary tickmarks are shown during adjustment (tertiaryTickmarkInterval=2).
|
|
95
|
+
- [Setpoint Radial Adjustment Flow (interactive)](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-setpoint--setpoint-radial-adjustment-flow): **Setpoint Radial Adjustment Flow** - Interactive demo showing radial setpoint adjustment UX
|
|
96
|
+
|
|
97
|
+
This story demonstrates the complete setpoint adjustment workflow for radial instruments:
|
|
98
|
+
|
|
99
|
+
1. **t=0 (At setpoint)**: Fill at 30°, setpoint at 30° (equal state - 80% size)
|
|
100
|
+
2. **t=1 (Initiate adjustment)**: User starts adjusting, newAngleSetpoint appears at same position
|
|
101
|
+
3. **t=2 (Move new setpoint)**: newAngleSetpoint moves to 60°, original setpoint stays dimmed at 30°
|
|
102
|
+
4. **t=3 (Confirm)**: newAngleSetpoint confirmed, fill animates to 60°, original setpoint moves to 60°
|
|
103
|
+
|
|
104
|
+
The `newAngleSetpoint` property enables showing both current and proposed setpoint positions
|
|
105
|
+
simultaneously, with the original dimmed (0.75 opacity) while adjusting.
|
|
106
|
+
|
|
107
|
+
Zero state is auto-derived when `angleSetpoint` is within `angleSetpointAtZeroDeadband` (default 0.5°).
|
|
108
|
+
- [Setpoint Azimuth Thruster Flow (interactive)](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-setpoint--setpoint-azimuth-thruster-flow): **Setpoint Azimuth Thruster Adjustment Flow** - Interactive demo showing multi-setpoint animation
|
|
109
|
+
|
|
110
|
+
This story demonstrates the setpoint animation on an azimuth-thruster, which has **two independent
|
|
111
|
+
setpoint axes**: angle (radial, via `<obc-watch>`) and thrust (linear, via `thruster()`).
|
|
112
|
+
|
|
113
|
+
Both axes animate simultaneously during confirm (t=3):
|
|
114
|
+
- Angle setpoint slides from 30° → 120° on the radial ring (CSS transition)
|
|
115
|
+
- Thrust setpoint slides from 25% → 70% on the linear bar (CSS transition)
|
|
116
|
+
- Both departing new-setpoint markers fade out at the same time
|
|
117
|
+
|
|
118
|
+
Angular transitions always take the shortest path via CSS-safe accumulated
|
|
119
|
+
angles, so even large or wraparound deltas animate correctly.
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Advice System
|
|
2
|
+
|
|
3
|
+
An advice marks part of an instrument's scale: a range or a single value the operator should steer into, or one to keep out of. Every instrument takes the same list and draws it with the same shapes and colours, so an optimal range looks alike on a compass, a bar and a chart.
|
|
4
|
+
|
|
5
|
+
[Story: Building Blocks/Advice / Visual State Comparison](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-advice--advice-comparison)
|
|
6
|
+
|
|
7
|
+
## Quick start
|
|
8
|
+
|
|
9
|
+
Give the instrument a list. Each entry names its category and a range, or a single value for a point:
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
const gauge = document.querySelector('obc-gauge-radial');
|
|
13
|
+
gauge.advices = [
|
|
14
|
+
{min: 40, max: 70, category: 'optimal'},
|
|
15
|
+
{min: 85, max: 100, category: 'caution'},
|
|
16
|
+
{value: 95, category: 'alarm'},
|
|
17
|
+
];
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The instrument does the rest: a band turns triggered while the instrument's value or setpoint is inside it.
|
|
21
|
+
|
|
22
|
+
In a Lit template the list is a property binding:
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
html`<obc-gauge-radial
|
|
26
|
+
minValue="0"
|
|
27
|
+
maxValue="100"
|
|
28
|
+
.value=${55}
|
|
29
|
+
.advices=${advices}
|
|
30
|
+
></obc-gauge-radial>`;
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## When to use
|
|
34
|
+
|
|
35
|
+
- **Show advices while they apply.** An advice comes from a decision-support, assistance or planning mode. Show the list while that mode is on and clear it when the mode ends. The vue demo, for one, shows its advices only while the A key is held.
|
|
36
|
+
- **Keep permanent limits on the scale.** A limit that is always there belongs to the scale's tick marks and labels.
|
|
37
|
+
- **Pick the category by intent.** A go-to category marks a value to follow, a no-go category a value to avoid.
|
|
38
|
+
|
|
39
|
+
## Categories
|
|
40
|
+
|
|
41
|
+
The alert categories take their alert colours when triggered, so an alarm limit reads as the alarm it is.
|
|
42
|
+
|
|
43
|
+
| Category | Group | Use it for | When triggered |
|
|
44
|
+
| ----------- | ----- | --------------------------------------------- | ----------------------- |
|
|
45
|
+
| `optimal` | Go-to | The suggested value or range | Enhanced blue |
|
|
46
|
+
| `running` | Go-to | The range the system normally runs in | Running green |
|
|
47
|
+
| `eco` | Go-to | The economical range | Mint |
|
|
48
|
+
| `ai` | Go-to | A suggestion from a simulation or an analysis | Indigo |
|
|
49
|
+
| `caution` | No-go | A high or low value that needs attention | Caution yellow, striped |
|
|
50
|
+
| `warning` | No-go | A warning limit | Warning orange |
|
|
51
|
+
| `alarm` | No-go | A high-high or low-low alarm limit | Alarm red |
|
|
52
|
+
| `exclusion` | No-go | A range the equipment must not be used in | Grey hairline hatch |
|
|
53
|
+
|
|
54
|
+
Lists written for earlier releases keep working: `advice` is read as `optimal` and `safe` as `running`. `obc-readout-block` takes the same category names except `ai` and `exclusion`, which have no readout style yet.
|
|
55
|
+
|
|
56
|
+
## States
|
|
57
|
+
|
|
58
|
+
Every category has four looks. The list sets the state a band rests in, and the instrument switches a band to `triggered` while a reading is inside it.
|
|
59
|
+
|
|
60
|
+
| State | Looks like | Meaning |
|
|
61
|
+
| ----------- | ----------------------------------------------------- | ------------------------------------------------------------ |
|
|
62
|
+
| `hinted` | Light grey outline, stripes or fill | Present, but not where the operator should look |
|
|
63
|
+
| `enabled` | Darker grey outline, stripes or fill | Visible; the default when an entry gives no state |
|
|
64
|
+
| `active` | The category's tint and outline | The band the operator is guided towards |
|
|
65
|
+
| `triggered` | The category's full colour; boundary ticks go primary | A reading is inside the band; the instrument sets this state |
|
|
66
|
+
|
|
67
|
+
### Emphasis
|
|
68
|
+
|
|
69
|
+
`adviceEmphasis` chooses the resting states for you, the way the design describes. With nothing triggered, go-to bands are `active` and no-go bands `enabled`. When a go-to band triggers, the no-go bands fade to `hinted`, and the other way round. It is off by default, because how strongly an advice should stand out is part of the application's alert philosophy.
|
|
70
|
+
|
|
71
|
+
The three gauges below share one list, with emphasis on, and read 40, 75 and 95:
|
|
72
|
+
|
|
73
|
+
[Story: Building Blocks/Advice / Resolution Stack (Radial)](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-advice--advice-resolution-stack)
|
|
74
|
+
|
|
75
|
+
## Shapes
|
|
76
|
+
|
|
77
|
+
- **Range** (`min`, `max`): a band beside the bar on the tick side, or on the ring. A go-to range is a pill, a no-go range is square with a small corner, and two bands that meet are cut flat where they join.
|
|
78
|
+
- **Point** (`value`): a go-to point is a dot, a no-go point is a short thick tick, the way a limit is drawn.
|
|
79
|
+
- **Area** (`showArea: true` on a range or a point): limit lines across the bar, the face or the chart, dotted for go-to and dashed or solid for no-go, tinted while triggered.
|
|
80
|
+
|
|
81
|
+
[Story: Building Blocks/Advice / Range and Point](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-advice--advice-range-and-point)
|
|
82
|
+
|
|
83
|
+
A tick mark at a band's end cuts a no-go band flush and insets a go-to pill. `hideMinTickmark` and `hideMaxTickmark` leave that end rounded instead.
|
|
84
|
+
|
|
85
|
+
## Icons
|
|
86
|
+
|
|
87
|
+
`showIcon: true` on an entry draws the category's icon beside the band, centred on the range: on a bar in the label column, or past the labels when the scale draws a tick ladder, on a ring outside the frame at the band's mid-angle. A scale that shows icons reserves the column, so a chart or a tank around it insets by it. At rest it is the outline icon in the tick-label grey; triggered, a go-to category keeps the outline in the band's colour and an alert category switches to its IEC icon. The field is per entry, so an application can mark every advice or only the ones it wants explained; the design sets show it on all or none.
|
|
88
|
+
|
|
89
|
+
[Story: Building Blocks/Advice / Icons](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-advice--advice-icons)
|
|
90
|
+
|
|
91
|
+
## Try it
|
|
92
|
+
|
|
93
|
+
Change the category, the state and the readings to see how one band responds on a bar and on a radial gauge.
|
|
94
|
+
|
|
95
|
+
[Story: Building Blocks/Advice / Playground](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-advice--playground)
|
|
96
|
+
|
|
97
|
+
## API
|
|
98
|
+
|
|
99
|
+
### Properties
|
|
100
|
+
|
|
101
|
+
Every instrument that draws advices has these three properties. The compass, heading, compass sector and wind propulsion instruments also name their list for the quantity it advises, `headingAdvices` and `sailAngleAdvices`, as `headingSetpoint` stands beside `setpoint`; both names are the same list. Three exceptions are listed under [Instruments](#instruments): `obc-azimuth-thruster` (`angleAdvices`, `thrustAdvices`) and `obc-main-engine` (`thrustAdvices`, `speedAdvices`) have two lists that share one trigger and emphasis, and `obc-pitch-roll-heave` has `heaveAdvice` alone. `obc-gauge-trend`, `obc-automation-tank` and `obc-depth` also keep the whole layer behind `hasAdvice`, which is off by default.
|
|
102
|
+
|
|
103
|
+
| Property | Type | Default | Description |
|
|
104
|
+
| ---------------- | ----------------------------------- | -------- | --------------------------------------------------------------------- |
|
|
105
|
+
| `advices` | `AdviceInput[]` | `[]` | Ranges and points, in the instrument's unit |
|
|
106
|
+
| `adviceTrigger` | `'both'`, `'value'` or `'setpoint'` | `'both'` | Which reading triggers a band: the value, the setpoint, or either one |
|
|
107
|
+
| `adviceEmphasis` | `boolean` | `false` | Applies the resting rules described under [Emphasis](#emphasis) |
|
|
108
|
+
|
|
109
|
+
### Advice entries
|
|
110
|
+
|
|
111
|
+
| Field | Type | Description |
|
|
112
|
+
| ------------------------------------ | ---------------- | ------------------------------------------------------------------------------------- |
|
|
113
|
+
| `category` | `AdviceCategory` | Required. One of the seven categories |
|
|
114
|
+
| `min`, `max` | `number` | A range, in the instrument's unit |
|
|
115
|
+
| `value` | `number` | A point, instead of `min` and `max` |
|
|
116
|
+
| `state` | `AdviceState` | `hinted`, `enabled`, `active` or `triggered`; `enabled` when left out |
|
|
117
|
+
| `hideMinTickmark`, `hideMaxTickmark` | `boolean` | Leaves out the boundary tick at that end and rounds the end |
|
|
118
|
+
| `showArea` | `boolean` | Also draws the area: limit lines across the bar, face or chart, tinted when triggered |
|
|
119
|
+
| `showIcon` | `boolean` | Draws the category's icon beside the band, in the label column, centred on the range |
|
|
120
|
+
|
|
121
|
+
The types come from `@oicl/openbridge-webcomponents/dist/svghelpers/advice.js`: `AdviceCategory`, `AdviceState`, `AdviceTrigger`, `AdviceInput`, and `ResolvedAdvice` for an entry after the instrument has resolved it.
|
|
122
|
+
|
|
123
|
+
### Angular ranges
|
|
124
|
+
|
|
125
|
+
On a compass or any other angular instrument, a range runs clockwise from `min` to `max` and may cross north: `{min: 350, max: 10}` is a 20° band. A pair written the other way round, whose clockwise span would exceed 180°, is drawn the short way, so `{min: 200, max: 100}` is the band from 100 to 200. Write a band longer than 180° with the smaller angle first.
|
|
126
|
+
|
|
127
|
+
## Instruments
|
|
128
|
+
|
|
129
|
+
| Instruments | Unit | Notes |
|
|
130
|
+
| -------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | -------------------------------------------------------------------------------------------- |
|
|
131
|
+
| `obc-compass`, `obc-heading`, `obc-compass-sector` | Degrees | The list is `headingAdvices`; the shared `advices` is the same list |
|
|
132
|
+
| `obc-rudder` | Degrees | |
|
|
133
|
+
| `obc-wind-propulsion` | Degrees | The list is `sailAngleAdvices`; the shared `advices` is the same list |
|
|
134
|
+
| `obc-speed-gauge` | The gauge's speed unit | `speedAdvices` is a deprecated alias |
|
|
135
|
+
| `obc-instrument-radial`, `obc-gauge-radial`, `obc-rot-sector`, `obc-gauge-proportional`, `obc-gauge-generator`, `obc-gauge-motors-and-pumps` | The gauge's value | |
|
|
136
|
+
| `obc-azimuth-thruster` | Degrees and percent of thrust | Two lists, `angleAdvices` and `thrustAdvices`, sharing one trigger and emphasis |
|
|
137
|
+
| `obc-thruster` | Percent of thrust | A band across zero is split at zero |
|
|
138
|
+
| `obc-main-engine` | Percent of thrust and of speed | Two lists, `thrustAdvices` and `speedAdvices`, sharing one trigger and emphasis |
|
|
139
|
+
| `obc-bar-vertical`, `obc-bar-horizontal` | The scale's value | `advicePosition` places the band: `inner` (the default), `outer` or `center` |
|
|
140
|
+
| `obc-gauge-vertical`, `obc-gauge-horizontal` | The scale's value | |
|
|
141
|
+
| `obc-gauge-trend`, `obc-automation-tank`, `obc-depth` | The scale's value | `advice` is a deprecated alias; `hasAdvice`, off by default, switches the bands and areas on |
|
|
142
|
+
| `obc-depth-actual` | Depth units | `advice` is a deprecated alias; triggered by `depth` |
|
|
143
|
+
| `obc-draft-trim`, `obc-heave` | The scale's value | `advice` is a deprecated alias; triggered by the trend band, not by the current reading |
|
|
144
|
+
| `obc-pitch-roll-heave` | Metres | `heaveAdvice` is the heave column's list |
|
|
145
|
+
| `obc-line-graph`, `obc-area-graph` | The y axis | Areas only, see [Areas on a chart](#areas-on-a-chart) |
|
|
146
|
+
| `obc-watch` | Degrees | Draws the list as given; the instrument around it resolves the states |
|
|
147
|
+
|
|
148
|
+
## Areas on a chart
|
|
149
|
+
|
|
150
|
+
`obc-line-graph`, `obc-area-graph` and `obc-gauge-trend` draw an entry with `showArea` on the chart: the tint between the limits under the data, the limit lines over it. `obc-gauge-trend` also draws the bands on its side bar and triggers them on its value and setpoint, and shows neither until `hasAdvice` is on. A plain line graph has no reading and no such gate, so its bands keep the state the list gives them.
|
|
151
|
+
|
|
152
|
+
[Story: Instruments/Gauge Trend / With Advice Areas](https://openbridge-next-storybook.web.app/?path=/story/instruments-gauge-trend--gauge-trend-with-advice-area)
|
|
153
|
+
|
|
154
|
+
## More examples
|
|
155
|
+
|
|
156
|
+
- [Every category in every state on the watch face](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-advice--advice-comparison-radial)
|
|
157
|
+
- [A value moving through the bands](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-advice--advice-state-change-flow)
|
|
158
|
+
- On the watch: [categories](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-watch--advice-categories), [states](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-watch--advice-states), [point and area](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-watch--advice-point-and-area), [chained bands](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-watch--advice-chained)
|
|
159
|
+
- Use cases: [a course point on the compass](https://openbridge-next-storybook.web.app/?path=/story/instruments-compass--course-advice-point), [a limit point on the radial gauge](https://openbridge-next-storybook.web.app/?path=/story/instruments-gauge-radial--limit-point), [categories and an area on a tank](https://openbridge-next-storybook.web.app/?path=/story/automation-tanks-tank--advice-use-case), [a history on a line graph](https://openbridge-next-storybook.web.app/?path=/story/bars-and-graphs-line-graph--historical-advice)
|
|
160
|
+
|
|
161
|
+
Upgrading from 2.1? [Migrating from 2.1 to 2.2](https://openbridge-next-storybook.web.app/docs/introduction-migration-guide-2-1-to-2-2.md) lists the names earlier releases used and what changed on screen.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# 🚀 Project Status
|
|
2
|
+
|
|
3
|
+
**v2.0.0 is out.** It adds close to 60 components, among them motion and depth instruments, propulsion and
|
|
4
|
+
hydraulic automation symbols, tree navigation and a new readout family, together with about 100 fixes. Keyboard
|
|
5
|
+
navigation and accessibility are now tested on every change, next to the visual snapshots, so what works in your
|
|
6
|
+
application keeps working. Coming from 1.x? The [migration guide](https://openbridge-next-storybook.web.app/docs/introduction-migration-guide.md)
|
|
7
|
+
shows what to update.
|
|
8
|
+
|
|
9
|
+
v1.0.0 closed an incredibly productive first year, with more than 200 components implemented. The code was
|
|
10
|
+
officially opened by **Prince Sverre Magnus of Norway** and is publicly available, marking our first stable milestone.
|
|
11
|
+
|
|
12
|
+
# Getting Started
|
|
13
|
+
|
|
14
|
+
Upgrading from 1.x? The [Migration Guide](https://openbridge-next-storybook.web.app/docs/introduction-migration-guide.md) lists what changed in 2.0.
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
The package is publicly available on [npm](https://www.npmjs.com/package/@oicl/openbridge-webcomponents) — no authentication required.
|
|
19
|
+
|
|
20
|
+
1. **Install the package:**
|
|
21
|
+
```bash
|
|
22
|
+
npm install @oicl/openbridge-webcomponents
|
|
23
|
+
```
|
|
24
|
+
For Vue.js projects:
|
|
25
|
+
```bash
|
|
26
|
+
npm install @oicl/openbridge-webcomponents-vue
|
|
27
|
+
```
|
|
28
|
+
React, Angular, and Svelte wrappers are published as `@oicl/openbridge-webcomponents-react`, `-ng`, and `-svelte`.
|
|
29
|
+
|
|
30
|
+
2. **Choose a release channel:**
|
|
31
|
+
- The `latest` tag tracks the stable, production-ready releases (updated from the `stable` branch).
|
|
32
|
+
- The `next` tag tracks the active development releases (from the `develop` branch) and may include breaking changes. Install it with `npm install @oicl/openbridge-webcomponents@next`.
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
1. **Import the CSS file:**
|
|
37
|
+
```js
|
|
38
|
+
import '@oicl/openbridge-webcomponents/dist/openbridge.css';
|
|
39
|
+
```
|
|
40
|
+
2. **Set the color palette:**
|
|
41
|
+
```html
|
|
42
|
+
<html lang="en" data-obc-theme="day"></html>
|
|
43
|
+
```
|
|
44
|
+
3. **Set the global component size:**
|
|
45
|
+
```html
|
|
46
|
+
<body class="obc-component-size-regular"></body>
|
|
47
|
+
```
|
|
48
|
+
4. **Install the Noto Sans font:**
|
|
49
|
+
```css
|
|
50
|
+
@font-face {
|
|
51
|
+
font-family: 'Noto Sans';
|
|
52
|
+
src: url('path/to/NotoSans.ttf');
|
|
53
|
+
font-weight: 400 700;
|
|
54
|
+
}
|
|
55
|
+
* {
|
|
56
|
+
font-family: Noto Sans;
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
5. **Import and use components:**
|
|
60
|
+
For web components:
|
|
61
|
+
|
|
62
|
+
```js
|
|
63
|
+
import '@oicl/openbridge-webcomponents/dist/components/top-bar/top-bar.js';
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
For Vue wrapper:
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
import ObcTopBar from '@oicl/openbridge-webcomponents-vue/components/top-bar/ObcTopBar.vue';
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
6. **Use in your project:**
|
|
73
|
+
```html
|
|
74
|
+
<obc-top-bar></obc-top-bar>
|
|
75
|
+
<!-- or with Vue -->
|
|
76
|
+
<ObcTopBar></ObcTopBar>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Licensing Model
|
|
80
|
+
|
|
81
|
+
The project will **always remain open source**, but with the 1.0.0 release it has transitioned to a new licensing system. Each version and each commit in the repository follows a "delayed" permissive license cycle, set out in [LICENSE.txt](https://github.com/Ocean-Industries-Concept-Lab/openbridge-webcomponents/blob/develop/LICENSE.txt):
|
|
82
|
+
|
|
83
|
+
1. **Initial Release:** Each new version, and each commit in the repository, is licensed under **AGPL-3.0-only** for the first 180 days after it is first made public.
|
|
84
|
+
2. **Transition:** After 180 days (the "Change Date"), that version or commit also becomes available under **Apache 2.0**, irrevocably.
|
|
85
|
+
3. **JIP Members:** Members of the [Joint Industry Project](https://openbridge-next-storybook.web.app/docs/introduction-join-the-project.md) can obtain a **commercial license** that permits use before the Change Date without the AGPL obligations. Membership is granted by the project: you register through the [support form](https://docs.google.com/forms/d/e/1FAIpQLSc6JVRyyIease2PkUArirNkG0DeTB__YnWEovjVwISlaYdktA/viewform) and pay the membership fee; contributing code does not make you a member. A commercial license does not include redistribution under Apache 2.0 before the Change Date.
|
|
86
|
+
|
|
87
|
+
> **Example:**
|
|
88
|
+
> If version 1.2.2 is released on **August 14, 2026**:
|
|
89
|
+
>
|
|
90
|
+
> - **open-source projects and internal users** can use it immediately under AGPL-3.0-only.
|
|
91
|
+
> - **JIP members** can use it immediately under a **commercial license**.
|
|
92
|
+
> - From **February 10, 2027**, version 1.2.2 becomes available to everyone under the **Apache 2.0** license (e.g., for commercial use without AGPL restrictions).
|
|
93
|
+
|
|
94
|
+
For more details visit the [OpenBridge Design System website](https://www.openbridge.no/).
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Introduction
|
|
2
|
+
|
|
3
|
+
OpenBridge Web Components is part of the OpenBridge Design System, an open-source framework for designing and implementing high-performance user interfaces for industrial and maritime workplaces. The system is based on modern UI principles, industry regulations, and human-centered design practices, and is developed in collaboration with leading industry and academic partners.
|
|
4
|
+
|
|
5
|
+
The OpenBridge Design System provides a comprehensive set of guidelines, components, and tools to ensure consistency, usability, and safety in complex environments. Originally created for maritime use cases, it now supports a wide range of industrial applications.
|
|
6
|
+
|
|
7
|
+
Learn more about the OpenBridge Design System at [openbridge.no](https://www.openbridge.no/).
|
|
8
|
+
|
|
9
|
+
## Release channels
|
|
10
|
+
|
|
11
|
+
OpenBridge Web Components is published in two parallel channels. Each channel
|
|
12
|
+
has its own Storybook deployment so you can browse the exact set of components
|
|
13
|
+
that ships with the npm tag you depend on.
|
|
14
|
+
|
|
15
|
+
- **[Stable Storybook](https://openbridge-storybook.web.app)** — built from the
|
|
16
|
+
`stable` branch and published to the `latest` npm tag roughly once every
|
|
17
|
+
quarter. Use this for production work; the API is frozen between releases.
|
|
18
|
+
- **[Develop Storybook](https://openbridge-next-storybook.web.app)** <em>(You are here)</em> — built
|
|
19
|
+
from the `develop` branch and published to the `next` npm tag on every merge.
|
|
20
|
+
Includes upcoming features and fixes that have not yet shipped to `stable`,
|
|
21
|
+
and may contain breaking changes.
|
|
22
|
+
|
|
23
|
+
You can jump to the stable build at any time using the **View Stable Build**
|
|
24
|
+
link under the OpenBridge wordmark in the sidebar.
|
|
25
|
+
|
|
26
|
+
When running Storybook locally with `npm run storybook`, the build reflects
|
|
27
|
+
whichever branch is currently checked out — typically `develop`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Joint Industry Project (JIP)
|
|
2
|
+
|
|
3
|
+
The OpenBridge Web Components library is developed as part of a Joint Industry Project (JIP), bringing together industry partners and academic institutions to advance the design and implementation of user interfaces for industrial and maritime workplaces.
|
|
4
|
+
|
|
5
|
+
## What is the JIP?
|
|
6
|
+
|
|
7
|
+
The JIP is a collaborative initiative where partners funds the implementation of the OpenBridge Web Components library. The project aims to create open, standardized solutions for high-performance workplaces.
|
|
8
|
+
|
|
9
|
+
## How to Join
|
|
10
|
+
|
|
11
|
+
Access to the codebase is currently limited to JIP partners and donors until the public release in March 2026. If you or your organization would like to participate, contribute, or gain early access, you can register your interest using [this form](https://docs.google.com/forms/d/e/1FAIpQLSd2H7bbL_duBTMhHzjw7W52H9XXAiJ9A3sL7PsrfCTW_bNUhw/viewform) or read more about the project [here](https://docs.google.com/document/d/18ytBiUrfQrMYOPPz-hd7pgPjnG8ZBG-zr9xYl5Y2TTs/edit?tab=t.0).
|