Skip to content

Commit

Permalink
feat: bind gestures to components (#31)
Browse files Browse the repository at this point in the history
Co-authored-by: Norbert Nader <nnader@amazon.com>
  • Loading branch information
NorbertNader and NorbertNader committed Jan 11, 2022
1 parent b9eabc2 commit c48e114
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,15 @@ it('updates with new query', async () => {
],
});
});

//TODO: Backfill these tests.
// Onboard cypress and try the component test runner https://www.cypress.io/blog/2021/04/06/introducing-the-cypress-component-test-runner/
describe('handles gestures', () => {
it('panning', () => {
//TODO: Make sure data is requested for new viewport range when panning back in time
});

it('zooming', () => {
//TODO: Make sure correct resolution is displayed for selected viewport range based on resolution mapping
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Prop, State, Watch } from '@stencil/core';
import { Component, Listen, Prop, State, Watch } from '@stencil/core';
import { DataStream } from '@synchro-charts/core';
import isEqual from 'lodash.isequal';
import {
Expand Down Expand Up @@ -64,6 +64,18 @@ export class IotConnector {
}
}

@Listen('dateRangeChange')
private handleDateRangeChange({ detail: [start, end, lastUpdatedBy] }: { detail: [Date, Date, string | undefined] }) {
if (this.update != null) {
this.update({
request: {
...this.request,
viewport: {start, end, lastUpdatedBy}
},
});
}
}

render() {
const { dataStreams } = this;

Expand Down

0 comments on commit c48e114

Please sign in to comment.