Nice... I'm going to refer to this in my introductory class ( https://observablehq.com/collection/@mariodelgadosr/observable-for-active-retirement-communities ) as an example of value-added 'forking' of a notebook.
Quick note: You can also comment-out (remove) any references to correlations.subtitle and correlations.isolation (subtitle property and vl.opacity encoding) in your generalized function.
The function works fine when importing, but live real-time use in this notebook shows attributes being used when the correlations radio buttons are used.
Jurian:
I had a thought last night. Like what I did for the Sankey App, it would be beneficial to have the complete heatmap (Correlation radio buttons, Color Scheme Selection and VegaLite markBar) parameterized for any dataset passed to it. The radio-button options provide value-added insight to the analyses.
So, I'm going to build on your work and make an app/function where the parameters have optional callbacks for the transform lookups (a programmer may or may not need translated tooltips) and calculates the subtitle based on input parameters to the function. I'll post back here when I'm done.
I updated and republished my notebook making it a complete app. See the updated 'Usage' documentation.
A simple test on this notebook with your data would be:
import {correlationHeatMap as newCorrelationHeatMap} with {testDataFork as data} from "@mariodelgadosr/dow-jones-industrial-average-correlation-analysis-with-ar"
then simply reference:
newCorrelationHeatMap in a cell.
You can also pass 'metricName', 'title', 'lookupTable' as optional parameters.