Skip to content

Commit

Permalink
Merge branch 'main' into documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanalvizo committed May 23, 2024
2 parents 92e0b5e + f267572 commit 41e0fce
Show file tree
Hide file tree
Showing 133 changed files with 37,709 additions and 8,367 deletions.
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# templates cannot be properly checked for formatting due to the substitution syntax
exclude: templates
repos:
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.15.0
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ pre-commit run --all-files
All steps should pass.

To bypass the pre-commit hook, you can commit with the `--no-verify` flag, for example:

```shell
git commit --no-verify -m "commit message"`
```
Expand All @@ -67,7 +68,7 @@ We use [Playwright](https://playwright.dev/) for end-to-end tests. We test again

You should be able to pass arguments to these commands as if you were running Playwright via CLI directly. For example, to test only `matplotlib.spec.ts` you could run `npm run e2e:docker -- ./tests/matplotlib.spec.ts`, or to test only `matplotlib.spec.ts` in Firefox, you could run `npm run e2e:docker -- --project firefox ./tests/matplotlib.spec.ts`. See [Playwright CLI](https://playwright.dev/docs/test-cli) for more details.

It is highly recommended to use `npm run e2e:docker` (instead of `npm run e2e`) as CI also uses the same environment. You can also use `npm run e2e:update-snapshots` to regenerate snapshots in said environment.
It is highly recommended to use `npm run e2e:docker` (instead of `npm run e2e`) as CI also uses the same environment. You can also use `npm run e2e:update-snapshots` to regenerate snapshots in said environment. Run Playwright in [UI Mode](https://playwright.dev/docs/test-ui-mode) with `npm run e2e:ui` when creating new tests or debugging, as this will allow you to run each test individually, see the browser as it runs it, inspect the console, evaluate locators, etc.

### Running Python tests

Expand Down Expand Up @@ -229,6 +230,6 @@ After you have successfully run `tools/release.sh` once, you should be able to d

As part of the release process, `cog` will, per our `cog.toml` configuration, invoke `tools/update_version.sh <packageName> <newVersion>`, which is a script that uses `sed` to update a plugin's version number in whatever source file we happen to use as the source of truth for version information in the given plugin.
*[WARNING]* If you change where the source of truth for a plugin's version is located, you must update `tools/update_version.sh` to update the correct file with a new version number.
_[WARNING]_ If you change where the source of truth for a plugin's version is located, you must update `tools/update_version.sh` to update the correct file with a new version number.

We use `tools/update_version.sh` to remove any `.dev0` "developer version" suffix before creating a release, and to put the `.dev0` version suffix back after completing the release.
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ services:
- 10000
volumes:
- ./docker/data/:/data
- ./tests/app.d:/app.d
environment:
- START_OPTS=-Xmx4g -DAuthHandlers=io.deephaven.auth.AnonymousAuthenticationHandler -Ddeephaven.console.type=python -Ddeephaven.application.dir=./app.d
2 changes: 0 additions & 2 deletions docker/data/storage/notebooks/DEMO.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ def filterable_plot(source):
on_change=set_value,
label="Sym",
label_position="side",
marginX=10,
marginTop=10,
),
dx.line(t, x="timestamp", y="price", by=["exchange"]),
]
Expand Down
15,218 changes: 7,429 additions & 7,789 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
"test:ci": "run-p test:ci:*",
"test:ci:unit": "jest --config jest.config.unit.cjs --ci --cacheDirectory $PWD/.jest-cache",
"test:ci:lint": "jest --config jest.config.lint.cjs --ci --cacheDirectory $PWD/.jest-cache",
"e2e": "playwright run",
"e2e": "playwright test",
"e2e:ui": "playwright test --ui",
"e2e:docker": "DEEPHAVEN_PORT=10001 ./tools/run_docker.sh e2e-tests",
"e2e:update-snapshots": "./tools/run_docker.sh update-snapshots",
"update-dh-packages": "lerna run --concurrency 1 update-dh-packages"
"update-dh-packages": "lerna run --concurrency 1 update-dh-packages",
"update-dh-packages:ui": "npm run update-dh-packages -- --scope=@deephaven/js-plugin-ui --"
},
"devDependencies": {
"@deephaven/babel-preset": "^0.72.0",
Expand Down
26 changes: 26 additions & 0 deletions plugins/matplotlib/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Changelog
All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.

- - -
## matplotlib-v0.4.1 - 2024-05-16
#### Documentation
- Update some information about Matplotlib (#467) - (bb9bda5) - mofojed

- - -

## matplotlib-v0.4.0 - 2024-05-16
#### Bug Fixes
- Type fixes and require pyright (#302) - (d5d003d) - Joe
#### Build system
- Bump version number to 0.5.0 for matplotlib (#466) - (4e5f19a) - mofojed
- Fix npm package update (#361) - (cabbcab) - mofojed
- Update dh ui packages to ^0.66.1 (#330) - (9433a98) - bmingles
- Version bump matplotlib to v0.4.0.dev0 (#188) - (a7daf6a) - Joe
#### Features
- Package matplotlib and ui JS with wheel (#343) - (7724e55) - Joe
- Support lerna scopes in npm start (#203) - (aab9591) - bmingles
- Update Matplotlib plugin to register widget view (#189) - (cd52fb2) - mofojed

- - -

Changelog generated by [cocogitto](https://github.com/cocogitto/cocogitto).
6 changes: 3 additions & 3 deletions plugins/matplotlib/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Deephaven Plugin for matplotlib
# Deephaven Plugin for Matplotlib

The Deephaven Plugin for matplotlib. Allows for opening matplotlib plots in a Deephaven environment. Any matplotlib plot
The Deephaven Plugin for Matplotlib. Allows for opening Matplotlib plots in a Deephaven environment. Any Matplotlib plot
should be viewable by default. For example:

```python
Expand All @@ -15,7 +15,7 @@ You can also use `TableAnimation`, which allows updating a plot whenever a Deeph

## `TableAnimation` Usage

`TableAnimation` is a matplotlib `Animation` that is driven by updates in a Deephaven Table. Every time the table that
`TableAnimation` is a Matplotlib `Animation` that is driven by updates in a Deephaven Table. Every time the table that
is being listened to updates, the provided function will run again.

### Line Plot
Expand Down
2 changes: 1 addition & 1 deletion plugins/matplotlib/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = deephaven-plugin-matplotlib
description = Deephaven Plugin for matplotlib
long_description = file: README.md
long_description_content_type = text/markdown
version = 0.4.0.dev0
version = 0.4.1.dev0
url = https://github.com/deephaven/deephaven-plugins
project_urls =
Source Code = https://github.com/deephaven/deephaven-plugins
Expand Down
11 changes: 6 additions & 5 deletions plugins/matplotlib/src/js/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@deephaven/js-plugin-matplotlib",
"version": "0.4.0",
"description": "Deephaven matplotlib plugin",
"version": "0.4.1",
"description": "Deephaven Matplotlib plugin",
"keywords": [
"Deephaven",
"plugin",
Expand All @@ -13,12 +13,13 @@
"main": "dist/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/deephaven/web-client-ui"
"url": "git+https://github.com/deephaven/deephaven-plugins",
"directory": "plugins/matplotlib"
},
"bugs": {
"url": "https://github.com/deephaven/web-client-ui/issues"
"url": "https://github.com/deephaven/deephaven-plugins/issues"
},
"homepage": "https://github.com/deephaven/web-client-ui",
"homepage": "https://github.com/deephaven/deephaven-plugins/tree/main/plugins/matplotlib",
"scripts": {
"start": "vite build --watch",
"build": "vite build",
Expand Down
10 changes: 10 additions & 0 deletions plugins/plotly-express/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.

- - -
## plotly-express-v0.8.0 - 2024-05-16
#### Bug Fixes
- Improve TimePreprocessor code (#455) - (be887f7) - Joe
#### Features
- Plotly express downsampling (#453) - (0101436) - Matthew Runyon
#### Tests
- bump ts, eslint and prettier configs (#416) - (a4761cc) - Don

- - -

## plotly-express-v0.7.0 - 2024-04-03
#### Bug Fixes
- Ensure title is added to default figure (#396) - (2f0a8a0) - Joe
Expand Down
2 changes: 1 addition & 1 deletion plugins/plotly-express/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = deephaven-plugin-plotly-express
description = Deephaven Chart Plugin
long_description = file: README.md
long_description_content_type = text/markdown
version = 0.7.0.dev0
version = 0.8.0.dev0
url = https://github.com/deephaven/deephaven-plugins
project_urls =
Source Code = https://github.com/deephaven/deephaven-plugins
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ def timeline(
table: Table | None: (Default value = None)
A table to pull data from.
x_start: str | None: (Default value = None)
A column that contains starting x-axis values.
A column that contains starting x-axis values. Must be a `java.time.Instant` column.
x_end: str | None: (Default value = None)
A column that contains ending x-axis values.
A column that contains ending x-axis values. Must be a `java.time.Instant` column.
by: str | list[str] | None: (Default value = None)
A column or list of columns that contain values to plot the figure traces by.
All values or combination of values map to a unique design. The variable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

from ..shared import get_unique_names

from deephaven.time import to_j_instant
from deephaven.table import Table

NANOS_PER_MILLI = 1_000_000


class TimePreprocessor:
"""
Expand Down Expand Up @@ -45,12 +46,13 @@ def preprocess_partitioned_tables(
x_diff = get_unique_names(table, ["x_diff"])["x_diff"]

for table in tables:
# Times are assumed to be Instants which have nanosecond precision
# We convert them to milliseconds for plotly express
yield table.update_view(
[
f"{x_start} = (Instant) to_j_instant({x_start})",
f"{x_end} = (Instant) to_j_instant({x_end})",
f"{x_diff} = ((Instant) to_j_instant({x_end}) - "
f"(Instant) to_j_instant({x_start})) / 1000000",
f"{x_start} = {x_start}",
f"{x_end} = {x_end}",
f"{x_diff} = ({x_end} - {x_start}) / NANOS_PER_MILLI",
f"{y}",
]
), {"x_diff": x_diff}
7 changes: 7 additions & 0 deletions plugins/plotly-express/src/js/jest.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const baseConfig = require('../../../../jest.config.base.cjs');
const packageJson = require('./package');

module.exports = {
...baseConfig,
displayName: packageJson.name,
};
26 changes: 14 additions & 12 deletions plugins/plotly-express/src/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@deephaven/js-plugin-plotly-express",
"version": "0.7.0",
"version": "0.8.0",
"description": "Deephaven plotly express plugin",
"keywords": [
"Deephaven",
Expand Down Expand Up @@ -36,30 +36,32 @@
"update-dh-packages": "node ../../../../tools/update-dh-packages.mjs"
},
"devDependencies": {
"@deephaven/jsapi-types": "0.64.0",
"@deephaven/jsapi-types": "1.0.0-dev0.34.0",
"@types/deep-equal": "^1.0.1",
"@types/plotly.js": "^2.12.18",
"@types/plotly.js-dist-min": "^2.3.1",
"@types/react": "^17.0.2",
"@types/react-plotly.js": "^2.6.0",
"@vitejs/plugin-react-swc": "^3.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"typescript": "^4.5.4",
"vite": "~4.1.4"
},
"peerDependencies": {
"react": "^17.0.2"
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"dependencies": {
"@deephaven/chart": "0.64.0",
"@deephaven/components": "0.64.0",
"@deephaven/dashboard": "0.64.0",
"@deephaven/dashboard-core-plugins": "0.64.0",
"@deephaven/icons": "0.64.0",
"@deephaven/jsapi-bootstrap": "0.64.0",
"@deephaven/log": "0.64.0",
"@deephaven/plugin": "0.64.0",
"@deephaven/utils": "0.64.0",
"@deephaven/chart": "0.75.0",
"@deephaven/components": "0.75.0",
"@deephaven/dashboard": "0.75.0",
"@deephaven/dashboard-core-plugins": "0.75.0",
"@deephaven/icons": "0.75.0",
"@deephaven/jsapi-bootstrap": "0.75.0",
"@deephaven/log": "0.75.0",
"@deephaven/plugin": "0.75.0",
"@deephaven/utils": "0.75.0",
"deep-equal": "^2.2.1",
"plotly.js": "^2.29.1",
"plotly.js-dist-min": "^2.29.1",
Expand Down
6 changes: 3 additions & 3 deletions plugins/plotly-express/src/js/src/DashboardPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
PanelEvent,
useListener,
} from '@deephaven/dashboard';
import type { VariableDescriptor } from '@deephaven/jsapi-types';
import type { dh } from '@deephaven/jsapi-types';
import PlotlyExpressChartPanel from './PlotlyExpressChartPanel.js';
import type { PlotlyChartWidget } from './PlotlyExpressChartUtils.js';

Expand All @@ -27,7 +27,7 @@ export function DashboardPlugin(
fetch: () => Promise<PlotlyChartWidget>;
metadata?: Record<string, unknown>;
panelId?: string;
widget: VariableDescriptor;
widget: dh.ide.VariableDescriptor;
}) => {
const { type, name } = widget;
if (type !== 'deephaven.plot.express.DeephavenFigure') {
Expand All @@ -47,7 +47,7 @@ export function DashboardPlugin(
},
fetch,
},
title: name,
title: name ?? undefined,
id: panelId,
};

Expand Down
4 changes: 2 additions & 2 deletions plugins/plotly-express/src/js/src/PlotlyExpressChart.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +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 { dh } 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<Widget>
props: WidgetComponentProps<dh.Widget>
): JSX.Element | null {
const dh = useApi();
const { fetch } = props;
Expand Down
Loading

0 comments on commit 41e0fce

Please sign in to comment.