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: Version bump + loading spinner fixes #243

Merged
merged 5 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ tsconfig.tsbuildinfo
.tox/

.eslintcache
.jest-cache
.stylelintcache

# Ignore the test reports
Expand Down
2,081 changes: 1,371 additions & 710 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions plugins/plotly-express/src/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"build": "tsc && vite build"
},
"devDependencies": {
"@deephaven/jsapi-types": "0.55.0",
"@deephaven/jsapi-types": "0.62.0",
"@types/deep-equal": "^1.0.1",
"@types/plotly.js": "^2.12.18",
"@types/plotly.js-dist-min": "^2.3.1",
Expand All @@ -50,15 +50,15 @@
"react": "^17.0.2"
},
"dependencies": {
"@deephaven/chart": "0.55.0",
"@deephaven/components": "0.55.0",
"@deephaven/dashboard": "0.55.0",
"@deephaven/dashboard-core-plugins": "0.55.0",
"@deephaven/icons": "0.55.0",
"@deephaven/jsapi-bootstrap": "0.55.0",
"@deephaven/log": "0.55.0",
"@deephaven/plugin": "0.55.0",
"@deephaven/utils": "0.55.0",
"@deephaven/chart": "0.62.0",
"@deephaven/components": "0.62.0",
"@deephaven/dashboard": "0.62.0",
"@deephaven/dashboard-core-plugins": "0.62.0",
"@deephaven/icons": "0.62.0",
"@deephaven/jsapi-bootstrap": "0.62.0",
"@deephaven/log": "0.62.0",
"@deephaven/plugin": "0.62.0",
"@deephaven/utils": "0.62.0",
"deep-equal": "^2.2.1",
"plotly.js": "^2.23.0",
"plotly.js-dist-min": "^2.23.0",
Expand Down
3 changes: 2 additions & 1 deletion plugins/plotly-express/src/js/src/PlotlyExpressChart.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React, { useEffect, useRef, useState } from 'react';
import Plotly from 'plotly.js-dist-min';
import { Chart } from '@deephaven/chart';
import type { Widget } from '@deephaven/jsapi-types';
import { type WidgetComponentProps } from '@deephaven/plugin';
import { useApi } from '@deephaven/jsapi-bootstrap';
import PlotlyExpressChartModel from './PlotlyExpressChartModel.js';
import { useHandleSceneTicks } from './useHandleSceneTicks.js';

export function PlotlyExpressChart(
props: WidgetComponentProps
props: WidgetComponentProps<Widget>
): JSX.Element | null {
const dh = useApi();
const { fetch } = props;
Expand Down
11 changes: 11 additions & 0 deletions plugins/plotly-express/src/js/src/PlotlyExpressChartModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ export class PlotlyExpressChartModel extends ChartModel {

hasPendingUpdate = false;

hasInitialLoadCompleted = false;

override getData(): Partial<Data>[] {
const hydratedData = [...this.plotlyData];

Expand Down Expand Up @@ -329,6 +331,15 @@ export class PlotlyExpressChartModel extends ChartModel {
override fireUpdate(data: unknown): void {
super.fireUpdate(data);
this.hasPendingUpdate = false;

// TODO: This will fire on first call to `fireUpdate` even though other data
// may still be loading. We should consider making this smarter to fire after
// all initial data has loaded.
// https://github.com/deephaven/deephaven-plugins/issues/267
if (!this.hasInitialLoadCompleted) {
this.fireLoadFinished();
this.hasInitialLoadCompleted = true;
}
}

pauseUpdates(): void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React, { useCallback, useRef, useState } from 'react';
import Plotly from 'plotly.js-dist-min';
import { ChartPanel, ChartPanelProps } from '@deephaven/dashboard-core-plugins';
import type { Widget } from '@deephaven/jsapi-types';
import { type WidgetPanelProps } from '@deephaven/plugin';
import { useApi } from '@deephaven/jsapi-bootstrap';
import PlotlyExpressChartModel from './PlotlyExpressChartModel.js';
import { useHandleSceneTicks } from './useHandleSceneTicks.js';

export function PlotlyExpressChartPanel(props: WidgetPanelProps) {
export function PlotlyExpressChartPanel(props: WidgetPanelProps<Widget>) {
const dh = useApi();
const { fetch, metadata = {}, ...rest } = props;
const containerRef = useRef<HTMLDivElement>(null);
Expand Down
3 changes: 2 additions & 1 deletion plugins/plotly-express/src/js/src/PlotlyExpressPlugin.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { type WidgetPlugin, PluginType } from '@deephaven/plugin';
import { vsGraph } from '@deephaven/icons';
import type { Widget } from '@deephaven/jsapi-types';
import { PlotlyExpressChart } from './PlotlyExpressChart.js';
import { PlotlyExpressChartPanel } from './PlotlyExpressChartPanel.js';

export const PlotlyExpressPlugin: WidgetPlugin = {
export const PlotlyExpressPlugin: WidgetPlugin<Widget> = {
name: '@deephaven/plotly-express',
type: PluginType.WIDGET_PLUGIN,
supportedTypes: 'deephaven.plot.express.DeephavenFigure',
Expand Down
4 changes: 4 additions & 0 deletions plugins/ui/src/js/src/DocumentHandler.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,17 @@ beforeEach(() => {
});

it('should throw an error if no children to render', () => {
TestUtils.disableConsoleOutput();

const children = makeDocument();
expect(() => render(makeDocumentHandler({ children }))).toThrow(
NoChildrenError
);
});

it('should throw an error if the document mixes panel and non-panel elements', () => {
TestUtils.disableConsoleOutput();

const children = makeDocument([
makeElement(PANEL_ELEMENT_NAME),
makeElement('not panel element'),
Expand Down
Loading