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

Redesign register_facet_classes plugin hook #830

Open
simonw opened this issue Jun 10, 2020 · 3 comments
Open

Redesign register_facet_classes plugin hook #830

simonw opened this issue Jun 10, 2020 · 3 comments

Comments

@simonw
Copy link
Owner

simonw commented Jun 10, 2020

Nothing uses this plugin hook yet, so the design is not yet proven.

I'm going to build a real plugin against it and use that process to inform any design changes that may need to be made.

I'll add a warning about this to the documentation.

@simonw simonw added the plugins label Jun 10, 2020
@simonw simonw added this to the Datasette 1.0 milestone Jun 10, 2020
simonw added a commit that referenced this issue Jun 10, 2020
Also documented policy that plugin hooks should not be shipped without a real example. Refs #818
simonw added a commit that referenced this issue Jun 12, 2020
@simonw
Copy link
Owner Author

simonw commented Nov 2, 2020

#427 had a bunch of ambitious plans for faceting that I haven't realized yet:

Think of all of the potential kinds of facets:

  • ?_facet_array=tags where tags is a JSON array of values
  • _facet_date=datetimecol - faceted by date part of a datetime
  • _facet_bins=numeric_column - can I do some kind of fancy binning here? Might need to take an argument
  • ?_facet_bins=numeric_column:5 - could be a way to take an argument. We’ll ignore columns with a : in their name.
  • ?_facet_json=jsoncol:jsonpath - could use a JSON path to extract out something to facet on?
  • ?_facet_percentile=numericcolumn - could this work?
  • ?_facet_function=column:sqlfunctionname - maybe this could be interesting? Would allow for e.g. facet by soundex
  • ?_facet_prefix=column:prefix - facet by terms but only if they start with a specific prefix
  • ?_facet_substring=column:3,6 - facet by a substr(column, 3, 6)

@mroswell
Copy link
Contributor

mroswell commented Apr 12, 2021

Related: #1285, including arguments for natural breaks, equal interval, etc. modeled after choropleth map legends.

@simonw
Copy link
Owner Author

simonw commented Dec 16, 2021

As of today, 16 December 2021, I'm still not seeing any evidence that anyone is using this hook (yet) according to GitHub code search: https://cs.github.com/?scopeName=All+repos&scope=&q=register_facet_classes%20-repo%3Asimonw%2Fdatasette

simonw added a commit that referenced this issue Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants