Skip to content

Commit

Permalink
Clean up TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
donmccurdy committed Jun 24, 2024
1 parent 2f41099 commit e93577f
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 15 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ build
coverage
custom-elements.json

# TODO: Prevent type defs being written for tests.
test/**/*.d.ts

# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.pnp.*
.yarn/*
Expand Down
3 changes: 1 addition & 2 deletions examples/01-pure-js/pure-js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,10 @@ function updateWidgets() {
* INITIALIZATION
*/

// TODO: Improve type definitions.
function bindWidget(selector: string): Widget {
const widget = document.querySelector<Widget>(selector)!;

(widget as any).addEventListener('filter', (event: FilterEvent) => {
widget.addEventListener('filter', (event: FilterEvent) => {
filters = event.detail.filters;
updateSources();
});
Expand Down
5 changes: 3 additions & 2 deletions examples/02-react/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
} from '../components/index-react.js';
import {MapView} from '@deck.gl/core';
import {VectorTileLayer} from '@deck.gl/carto';
import {FilterEvent} from '../components/types.js';

const MAP_VIEW = new MapView({repeat: true});
const MAP_STYLE =
Expand Down Expand Up @@ -80,7 +81,7 @@ export function App(): JSX.Element {
header="Store type"
operation="count"
column="storetype"
onfilter={(e) => setFilters((e as any).detail.filters)} // TODO: types
onfilter={(e) => setFilters((e as FilterEvent).detail.filters)}
></CategoryWidget>

<PieWidget
Expand All @@ -89,7 +90,7 @@ export function App(): JSX.Element {
header="Store type"
operation="count"
column="storetype"
onfilter={(e) => setFilters((e as any).detail.filters)} // TODO: types
onfilter={(e) => setFilters((e as FilterEvent).detail.filters)}
></PieWidget>

<TableWidget
Expand Down
2 changes: 1 addition & 1 deletion examples/components/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../tsconfig.json",
"include": ["**/*.ts"],
"compilerOptions": {
"plugins": [
Expand Down
4 changes: 2 additions & 2 deletions examples/components/widgets/category-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class CategoryWidget extends BaseWidget {
spatialFilter: this.getSpatialFilterOrViewState(),
operation,
column,
}); // TODO: signal
});
},
args: () =>
[
Expand Down Expand Up @@ -156,7 +156,7 @@ export class CategoryWidget extends BaseWidget {
categories.sort((a, b) => (a.value > b.value ? -1 : 1));

const data = categories.map(({name, value}, index) => {
let color = DEFAULT_PALETTE[index]; // TODO: >8 categories allowed?
let color = DEFAULT_PALETTE[index % DEFAULT_PALETTE.length];
if (this._filterValues.length > 0) {
color = this._filterValues.includes(name) ? color : '#cccccc';
}
Expand Down
2 changes: 1 addition & 1 deletion examples/components/widgets/formula-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class FormulaWidget extends BaseWidget {
operation,
column,
spatialFilter: this.getSpatialFilterOrViewState(),
}); // TODO: signal
});
return response.value;
},
args: () =>
Expand Down
2 changes: 1 addition & 1 deletion examples/components/widgets/histogram-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class HistogramWidget extends BaseWidget {
column,
operation,
ticks,
}); // TODO: signal
});
},
args: () =>
[
Expand Down
2 changes: 1 addition & 1 deletion examples/components/widgets/pie-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class PieWidget extends CategoryWidget {
categories.sort((a, b) => (a.value > b.value ? -1 : 1));

const data = categories.map(({name, value}, index) => {
let color = DEFAULT_PALETTE[index]; // TODO: >8 categories allowed?
let color = DEFAULT_PALETTE[index % DEFAULT_PALETTE.length];
if (this._filterValues.length > 0) {
color = this._filterValues.includes(name) ? color : '#cccccc';
}
Expand Down
2 changes: 1 addition & 1 deletion examples/components/widgets/scatter-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class ScatterWidget extends BaseWidget {
xAxisJoinOperation,
yAxisColumn,
yAxisJoinOperation,
}); // TODO: signal
});
},
args: () =>
[
Expand Down
2 changes: 1 addition & 1 deletion examples/components/widgets/table-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class TableWidget extends BaseWidget {
return widgetSource.getTable({
columns,
spatialFilter: this.getSpatialFilterOrViewState(),
}); // TODO: signal
});
},
args: () =>
[this.data, this.columns, this.viewState, this.spatialFilter] as const,
Expand Down

0 comments on commit e93577f

Please sign in to comment.