Skip to content

Redesign register_facet_classes plugin hook #830

Open

Description

@simonw

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.

Activity

  1. added this to the Datasette 1.0 milestone on Jun 10, 2020
  2. simonw commented on Nov 2, 2020

    @simonw
    OwnerAuthor

    #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)
  3. mroswell commented on Apr 12, 2021

    @mroswell
    SponsorContributor

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

  4. simonw commented on Dec 16, 2021

    @simonw
    OwnerAuthor

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions