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 docs site #2462

Merged
merged 5 commits into from
Dec 3, 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
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ jobs:
env:
PSP_USE_CCACHE: 1

- name: Docs Build
run: yarn docs

#################################
# Compress and upload Artifacts #
#################################
Expand Down
13 changes: 12 additions & 1 deletion docs/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@
const puppeteer = require("puppeteer");
const fs = require("fs");
const cp = require("child_process");
const path = require("node:path");
const mkdirp = require("mkdirp");
const EXAMPLES = require("./src/components/ExampleGallery/features.js").default;
const { convert } = require("@finos/perspective-viewer/dist/cjs/migrate.js");

const { WebSocketServer } = require("@finos/perspective");

const DEFAULT_VIEWPORT = {
width: 400,
height: 300,
Expand Down Expand Up @@ -101,11 +105,18 @@ async function run_with_theme(page, is_dark = false) {

async function run() {
if (!fs.existsSync("static/features")) {
const browser = await puppeteer.launch({ headless: false });
mkdirp(path.join(__dirname, "static/features"));
const server = new WebSocketServer({
assets: [path.join(__dirname, "..")],
});

const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
await run_with_theme(page);
await run_with_theme(page, true);
await page.close();
await browser.close();
await server.close();
}

// TODO There is a typescript module annoyingly called `blocks`.
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Perspective adds many of its own functions in addition to `ExprTK`'s standard
ones, including common functions for `datetime` and `string` types such as
`substring()`, `bucket()`, `day_of_week()`, etc. A full list of available
functions is available in the
[Expression Columns API](obj/perspective-viewer-exprtk).
[Expression Columns API](../obj/perspective-viewer-exprtk).

## Examples

Expand Down
8 changes: 1 addition & 7 deletions docs/src/components/ExampleGallery/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import EXAMPLES from "./features.js";
import styles from "./styles.module.css";
import BrowserOnly from "@docusaurus/BrowserOnly";

const { convert } = require("@finos/perspective-viewer/src/ts/migrate");
const { convert } = require("@finos/perspective-viewer/dist/cjs/migrate");

export default function ExampleGallery(props) {
const { colorMode } = useColorMode();
Expand Down Expand Up @@ -80,12 +80,6 @@ function OverlayDemo(props) {
const perspectiveRef = useCallback(
(viewer) => {
if (viewer !== null) {
// console.log(
// convert({
// ...EXAMPLES.default[props.index].config,
// settings: true,
// })
// );
viewer.load(SUPERSTORE_TABLE);
viewer.restore(
convert({
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import styles from "./index.module.css";

function HomepageHeader() {
const { siteConfig } = useDocusaurusContext();
console.log(siteConfig);

// const { colorMode, setColorMode } = useColorMode();
return (
<header className={clsx("hero", styles.heroBanner)}>
Expand Down
2 changes: 1 addition & 1 deletion packages/perspective/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"build": "node build.js",
"docs": "npm-run-all docs:jsdoc docs:deploy",
"docs:jsdoc": "jsdoc2md src/js/perspective.js -p list --separators --no-gfm > README.md",
"docs:deploy": "(echo \"---\nid: perspective\ntitle: perspective API\n---\n\n\"; cat README.md) > ../../docs/docs/obj/perspective.md",
"docs:deploy": "mkdir -p ../../docs/docs/obj && (echo \"---\nid: perspective\ntitle: perspective API\n---\n\n\"; cat README.md) > ../../docs/docs/obj/perspective.md",
"test:run": "jest --color --ci --rootDir=. --config=../../tools/perspective-test/jest.config.js",
"test": "npm-run-all test:run",
"clean": "rimraf dist"
Expand Down
2 changes: 1 addition & 1 deletion rust/perspective-viewer/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const BUILD = [
{
entryPoints: ["src/ts/perspective-viewer.ts"],
format: "esm",
plugins: [NodeModulesExternal()],
plugins: [NodeModulesExternal("@finos/perspective/")],
external: ["*.wasm", "*.worker.js"],
outdir: "dist/esm",
},
Expand Down
3 changes: 1 addition & 2 deletions rust/perspective-viewer/src/less/column-selector.less
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,10 @@

:host {
#add-expression {
border: var(--column-add--border, none);
border: var(--column-add--border, 1px solid transparent);
min-height: 24px;
flex-direction: row;
font-size: 12px;
border: 1px solid transparent;
background-color: #8b868045;
border-radius: 2px;
display: flex;
Expand Down
5 changes: 4 additions & 1 deletion rust/perspective-viewer/src/ts/migrate/2-6-1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ export default function migrate_2_6_1(old, options) {
old.version = new Semver(next_version);

// Migrate X/Y Scatter plugin
if (old.plugin === "X/Y Scatter") {
if (
old.plugin === "X/Y Scatter" &&
typeof old.plugin_config?.columns === "object"
) {
for (const i in old.plugin_config.columns) {
const entries = Object.entries(old.plugin_config.columns[i]);
const mapped_entries = entries.map(([grp_name, grp_val]) => {
Expand Down
Loading