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

Standalone JS pkg #16

Open
manzt opened this issue Jul 26, 2024 · 6 comments
Open

Standalone JS pkg #16

manzt opened this issue Jul 26, 2024 · 6 comments

Comments

@manzt
Copy link
Owner

manzt commented Jul 26, 2024

The custom DataTable Mosaic client should be published to npm and usable without the Python-based db.

@timelyportfolio
Copy link

@manzt Absolutely loving quak and would really like to see it available as a standalone JS package. If you pursue this option, would it be possible to add an option filterBy similar to mosaic/vgplot so that we can tie together DataTable with mosaic inputs? Here is a really, really ugly example (please excuse my foolish ignorance of Typescript and lots of other things) https://stackblitz.com/~/github.com/timelyportfolio/quak.

@domoritz
Copy link
Collaborator

In other words, make quak a mosaic component that satisfies the component interface?

@timelyportfolio
Copy link

@domoritz yes, would be a really nice addition to the components.

@timelyportfolio
Copy link

timelyportfolio commented Jul 28, 2024

And while I originally was only thinking the DataTable it would also be even nicer if each of the filters in the column headings would be available as input components. Not sure how much of a lift this would be. I am happy to help, but you can probably already see some of my limitations by the example.

@manzt
Copy link
Owner Author

manzt commented Jul 28, 2024

Yes! This is my intention. I think DataTable fits the definition of a "Mosaic component" (it extends from MosaicClient). Right now you could access the filterBy with:

import { coordinator } from "@uwdata/mosaic-core";
import { datatable } from "./lib/clients/DataTable.ts";

// setup df table in database...

const dt = await datatable("df", { coordinator: coordinator() });
const filterBy = dt.filterBy; // use with other clients

Originally I'd had this lifted up one level, where you could create and pass in the crossfilter selection (filterBy) yourself, but I don't see much of a difference between the APIs (and also potential to pass in a Selection that wasn't a crossfilter felt like a poor API design). Open to reverting to:

import { coordinator, Selection } from "@uwdata/mosaic-core";
import { datatable } from "./lib/clients/DataTable.ts";

// setup df table in database...
const filterBy = Selection.crossfilter();
const dt = await datatable("df", { coordinator: coordinator(), filterBy: filterBy });

if there are things I'm missing!

Just want to setup a minimal, public API to make the JS release in a way that interfaces very well with the rest of the mosaic ecosystem.

@manzt
Copy link
Owner Author

manzt commented Jul 28, 2024

Here is a really, really ugly example (please excuse my foolish ignorance of Typescript and lots of other things) stackblitz.com/~/github.com/timelyportfolio/quak.

wow, totally love that we can share (low-friction) ideas with stackblitz this way. new to me, thanks for sharing, @timelyportfolio :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants