Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gauge] - Able to add Gauge Widget to Dashboard #2635

Open
2 tasks
Tracked by #2624
corteggiano opened this issue Feb 28, 2024 · 2 comments
Open
2 tasks
Tracked by #2624

[Gauge] - Able to add Gauge Widget to Dashboard #2635

corteggiano opened this issue Feb 28, 2024 · 2 comments

Comments

@corteggiano
Copy link
Contributor

corteggiano commented Feb 28, 2024

❗ PLEASE MAKE THESE CHANGES UNDER A FEATURE FLAG
❗ PLEASE MAKE THESE CHANGES IN SMALL INCREMENTAL PRs AND NOT AT ONCE

Create a feature flag by setting a local_storage value and referencing it as this:
const hasGauge = !!localStorage?.getItem('HAS_GAUGE_WIDGET');

Implementation Steps:

  1. Add the following to iot-app-kit/packages/dashboard/src/customization/widgets/types.ts
export type GaugeProperties = QueryProperties & {
  gaugeThickness?: number;
  showName?: boolean;
  showUnit?: boolean;
  fontSize?: number;
  labelFontSize?: number;
  unitFontSize?: number;
  yMin?: number;
  yMax?: number;
};

export type GaugeWidget = DashboardWidget<GaugeProperties>;
  1. Create Gauge folder under iot-app-kit/packages/dashboard/src/customization/widgets

  2. In the folder, you will need the implement the following files (take a look at KPI for an idea of what to do for each file):

    • component.tsx - this is where you will use the react-component implementation
    • icon.tsx - Represents the icon that will be shown in the widget palette
    • plugin.tsx - Represents the initial state of all the settings when the widget is added to a dashboard
      Initial states should include an initialSize, showName: true, showUnit: true
  3. Users should be able to add the gauge widgets to the dashboard

    • Make sure you cannot add more than 1 property to a widget (we already do this for KPI so it should be the same behavior)

Dial Acceptance criteria

@corteggiano corteggiano changed the title [Dial and Gauge] - Able to add Gauge Widget to Dashboard [Gauge] - Able to add Gauge Widget to Dashboard Feb 29, 2024
@jmbuss
Copy link
Contributor

jmbuss commented Apr 25, 2024

Gauge (1)

svg for the component library section.

@corteggiano
Copy link
Contributor Author

here are the light and dark mode SVGs
gauge-light
gauge-dark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants