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

Dashboard Maps PoC #403

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Dashboard Maps PoC #403

wants to merge 10 commits into from

Conversation

czue
Copy link
Member

@czue czue commented Sep 30, 2024

Context / Working Spec Here

This PR has a few pieces that I used to make a little map PoC in the dashboard:

  1. A test data generator that generates random visits.
  2. A SQL query (based on the one used in superset) to format the map data.
  3. A view to show the data on a map.

This is the end result:

connect-map-poc.webm

Of course the data looks ridiculous when randomly generated, which is one reason it would be nice to have this deployed to the real app.

Copy link
Member Author

@czue czue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quick self-review for a bit more context

@@ -0,0 +1,91 @@
SELECT
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the original query. it isn't used for anything, i just didn't want to lose it.

@@ -0,0 +1,38 @@
SELECT
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this query was modified from one on the superset instance to remove a table that wasn't there (the original query is below)

completed_work = CompletedWorkFactory(
opportunity_access=opportunity_access,
status=CompletedWorkStatus.approved,
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably not right. But I don't think it matters at this stage.

{{ block.super }}
{{ user_visits|json_script:"userVisits" }}
<script type="module">
window.addEventListener('DOMContentLoaded', () => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the overwhelming majority of this is copy/pasted from here: https://docs.mapbox.com/mapbox-gl-js/example/cluster/

Just tweaked a few things to work with our data.

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

Successfully merging this pull request may close these issues.

1 participant