Skip to content

Commit

Permalink
Fix tooltips for other maps of health
Browse files Browse the repository at this point in the history
  • Loading branch information
edlu77 committed Feb 16, 2024
1 parent b298e8e commit 50219da
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 20 deletions.
34 changes: 24 additions & 10 deletions website/src/assets/pages/vis6-maps-of-health/vis.vl.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,27 @@
]
},
{
"calculate": "-datum.OD_DIFF",
"calculate": "datum.OVERDOSES == 0",
"as": "NO_FIRST_OD"
},
{
"calculate": "datum.TOTAL_PRESCRIPTIONS == 0",
"as": "NO_FIRST_RX"
},
{
"calculate": "datum.NO_FIRST_OD ? 'N/A' : year(datetime(datum.TIME_FIRST_OD)) + ' Q' + quarter(datetime(datum.TIME_FIRST_OD))",
"as": "TIME_FIRST_OD_VALUE"
},
{
"calculate": "datum.NO_FIRST_RX ? 'N/A' : year(datetime(datum.TIME_FIRST_RX)) + ' Q' + quarter(datetime(datum.TIME_FIRST_RX))",
"as": "TIME_FIRST_RX_VALUE"
},
{
"calculate": "datum.NO_FIRST_OD ? 'N/A' : -datum.OD_DIFF",
"as": "OD_DIFF_VALUE"
},
{
"calculate": "-datum.RX_DIFF",
"calculate": "datum.NO_FIRST_RX ? 'N/A' : -datum.RX_DIFF",
"as": "RX_DIFF_VALUE"
}
],
Expand Down Expand Up @@ -309,25 +325,23 @@
"title": "Total # of Prescriptions"
},
{
"field": "TIME_FIRST_OD",
"type": "temporal",
"timeUnit": "yearquarter",
"field": "TIME_FIRST_OD_VALUE",
"type": "nominal",
"title": "Time of 1st overdose"
},
{
"field": "TIME_FIRST_RX",
"type": "temporal",
"timeUnit": "yearquarter",
"field": "TIME_FIRST_RX_VALUE",
"type": "nominal",
"title": "Time of 1st prescription"
},
{
"field": "OD_DIFF_VALUE",
"type": "quantitative",
"type": "nominal",
"title": "Days from 1st overdose to death"
},
{
"field": "RX_DIFF_VALUE",
"type": "quantitative",
"type": "nominal",
"title": "Days from 1st prescription to death"
}
]
Expand Down
34 changes: 24 additions & 10 deletions website/src/assets/pages/vis6-maps-of-health/vis3.vl.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,27 @@
]
},
{
"calculate": "-datum.OD_DIFF",
"calculate": "datum.OVERDOSES == 0",
"as": "NO_FIRST_OD"
},
{
"calculate": "datum.TOTAL_PRESCRIPTIONS == 0",
"as": "NO_FIRST_RX"
},
{
"calculate": "datum.NO_FIRST_OD ? 'N/A' : year(datetime(datum.TIME_FIRST_OD)) + ' Q' + quarter(datetime(datum.TIME_FIRST_OD))",
"as": "TIME_FIRST_OD_VALUE"
},
{
"calculate": "datum.NO_FIRST_RX ? 'N/A' : year(datetime(datum.TIME_FIRST_RX)) + ' Q' + quarter(datetime(datum.TIME_FIRST_RX))",
"as": "TIME_FIRST_RX_VALUE"
},
{
"calculate": "datum.NO_FIRST_OD ? 'N/A' : -datum.OD_DIFF",
"as": "OD_DIFF_VALUE"
},
{
"calculate": "-datum.RX_DIFF",
"calculate": "datum.NO_FIRST_RX ? 'N/A' : -datum.RX_DIFF",
"as": "RX_DIFF_VALUE"
}
],
Expand Down Expand Up @@ -304,25 +320,23 @@
"title": "Total # of Prescriptions"
},
{
"field": "TIME_FIRST_OD",
"type": "temporal",
"timeUnit": "yearquarter",
"field": "TIME_FIRST_OD_VALUE",
"type": "nominal",
"title": "Time of 1st overdose"
},
{
"field": "TIME_FIRST_RX",
"type": "temporal",
"timeUnit": "yearquarter",
"field": "TIME_FIRST_RX_VALUE",
"type": "nominal",
"title": "Time of 1st prescription"
},
{
"field": "OD_DIFF_VALUE",
"type": "quantitative",
"type": "nominal",
"title": "Days from 1st overdose to death"
},
{
"field": "RX_DIFF_VALUE",
"type": "quantitative",
"type": "nominal",
"title": "Days from 1st prescription to death"
}
]
Expand Down

0 comments on commit 50219da

Please sign in to comment.