datasette-vega
datasette-vega copied to clipboard
Maybe check for `columns` rather than looking at `view_name`
trafficstars
diff --git a/datasette_vega/__init__.py b/datasette_vega/__init__.py
index ac80b52..ba69145 100644
--- a/datasette_vega/__init__.py
+++ b/datasette_vega/__init__.py
@@ -17,12 +17,12 @@ def cached_filepaths_for_extension(extension):
@hookimpl
-def extra_css_urls(view_name):
- if view_name == "table":
+def extra_css_urls(columns):
+ if columns:
return cached_filepaths_for_extension("css")
@hookimpl
-def extra_js_urls(view_name):
- if view_name == "table":
+def extra_js_urls(columns):
+ if columns:
return cached_filepaths_for_extension("js")
Found this diff on my laptop and I can't remember why or when I did it!
The view_name == "table" change caused the chart to disappear from the query page. I'd highly suggest applying this change to master.
I've merged this change into my working branch: https://github.com/brandonrobertz/datasette-vega