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

fix: use viewport from provider #515

Merged
merged 1 commit into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,160 changes: 618 additions & 542 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"@iot-app-kit/source-iotsitewise": "^2.6.4",
"@iot-app-kit/table": "^2.6.4",
"@stencil/core": "^2.7.0",
"@synchro-charts/core": "^7.0.0",
"@synchro-charts/core": "^7.1.5",
"styled-components": "^5.3.0"
},
"devDependencies": {
Expand Down Expand Up @@ -88,4 +88,4 @@
"nth-check": "^2.1.1"
},
"license": "Apache-2.0"
}
}
2 changes: 0 additions & 2 deletions packages/components/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ export namespace Components {
interface IotTimeSeriesConnector {
"annotations": Annotations;
"assignDefaultColors": boolean | undefined;
"initialViewport": Viewport;
"provider": Provider<TimeSeriesData[]>;
"renderFunc": (data: TimeSeriesData) => void;
"styleSettings": StyleSettingsMap | undefined;
Expand Down Expand Up @@ -437,7 +436,6 @@ declare namespace LocalJSX {
interface IotTimeSeriesConnector {
"annotations"?: Annotations;
"assignDefaultColors"?: boolean | undefined;
"initialViewport"?: Viewport;
"provider"?: Provider<TimeSeriesData[]>;
"renderFunc"?: (data: TimeSeriesData) => void;
"styleSettings"?: StyleSettingsMap | undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ export class IotBarChart {
assignDefaultColors
annotations={this.annotations}
supportedDataTypes={['NUMBER']}
renderFunc={({ dataStreams, annotations }) => (
renderFunc={({ dataStreams, annotations, viewport }) => (
<sc-bar-chart
widgetId={this.widgetId}
viewport={this.viewport}
viewport={viewport}
size={this.size}
movement={this.movement}
scale={this.scale}
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/components/iot-kpi/iot-kpi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ export class IotKpi {
styleSettings={this.styleSettings}
annotations={this.annotations}
supportedDataTypes={['NUMBER', 'STRING', 'BOOLEAN']}
renderFunc={({ dataStreams, annotations }) => (
renderFunc={({ dataStreams, annotations, viewport }) => (
<sc-kpi
dataStreams={dataStreams as SynchroChartsDataStream[]}
annotations={annotations}
viewport={this.viewport}
viewport={viewport}
isEditing={this.isEditing}
widgetId={this.widgetId}
messageOverrides={this.messageOverrides}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ export class IotLineChart {
assignDefaultColors
annotations={this.annotations}
supportedDataTypes={['NUMBER']}
renderFunc={({ dataStreams, annotations }) => {
renderFunc={({ dataStreams, annotations, viewport }) => {
return (
<sc-line-chart
widgetId={this.widgetId}
viewport={this.viewport}
viewport={viewport}
size={this.size}
movement={this.movement}
scale={this.scale}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ export class IotScatterChart {
assignDefaultColors
annotations={this.annotations}
supportedDataTypes={['NUMBER']}
renderFunc={({ dataStreams, annotations }) => {
renderFunc={({ dataStreams, annotations, viewport }) => {
return (
<sc-scatter-chart
dataStreams={dataStreams as SynchroChartsDataStream[]}
annotations={annotations}
viewport={this.viewport}
viewport={viewport}
isEditing={this.isEditing}
widgetId={this.widgetId}
movement={this.movement}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ export class IotStatusGrid {
styleSettings={this.styleSettings}
annotations={this.annotations}
supportedDataTypes={['NUMBER', 'STRING', 'BOOLEAN']}
renderFunc={({ dataStreams, annotations }) => (
renderFunc={({ dataStreams, annotations, viewport }) => (
<sc-status-grid
dataStreams={dataStreams as SynchroChartsDataStream[]}
annotations={annotations}
viewport={this.viewport}
viewport={viewport}
isEditing={this.isEditing}
widgetId={this.widgetId}
labelsConfig={this.labelsConfig}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ export class IotStatusTimeline {
assignDefaultColors
annotations={this.annotations}
supportedDataTypes={['NUMBER', 'STRING', 'BOOLEAN']}
renderFunc={({ dataStreams, annotations }) => {
renderFunc={({ dataStreams, annotations, viewport }) => {
const alarmStreamAnnotations = getAlarmStreamAnnotations({ annotations, dataStreams });
const combinedAnnotations = combineAnnotations(this.annotations, alarmStreamAnnotations);

return (
<sc-status-timeline
dataStreams={dataStreams as SynchroChartsDataStream[]}
annotations={combinedAnnotations}
viewport={this.viewport}
viewport={viewport}
isEditing={this.isEditing}
widgetId={this.widgetId}
gestures={this.gestures}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, Prop, State, Watch } from '@stencil/core';
import { Provider, StyleSettingsMap, TimeSeriesData, Viewport, DataType } from '@iot-app-kit/core';
import { Provider, StyleSettingsMap, TimeSeriesData, DataType } from '@iot-app-kit/core';
import { bindStylesToDataStreams } from '../common/bindStylesToDataStreams';
import { combineAnnotations } from '../common/combineAnnotations';
import { Annotations } from '@synchro-charts/core';
Expand Down Expand Up @@ -33,8 +33,6 @@ export class IotTimeSeriesConnector {

@Prop() renderFunc: (data: TimeSeriesData) => void;

@Prop() initialViewport: Viewport;

@Prop() styleSettings: StyleSettingsMap | undefined;

@Prop() assignDefaultColors: boolean | undefined;
Expand Down