visdesignlab / upset2

UpSet - Visualizing Intersecting Sets
https://upset.multinet.app/
BSD 3-Clause "New" or "Revised" License
54 stars 7 forks source link

refactor: 💡 collapse state stored in provenance and grammar #141

Closed JakeWags closed 1 year ago

JakeWags commented 1 year ago

Does this PR close any open issues?

Closes #139

Give a longer description of what this PR addresses and why it's needed

This PR adds the collapsed ids to the provenance and the grammar as a list of strings. Collapse all appends all ids to the array in a single provenance action. Similarly, expand all removes all items in a single action.

Provide pictures/videos of the behavior before and after these changes (optional)

Provenance example: image

Exported grammar from the state pictured above:

{
  "firstAggregateBy": "Degree",
  "firstOverlapDegree": 2,
  "secondAggregateBy": "Sets",
  "secondOverlapDegree": 2,
  "sortBy": "Cardinality",
  "filters": {
    "maxVisible": 3,
    "minVisible": 0,
    "hideEmpty": true
  },
  "visibleSets": [
    "Set_Action",
    "Set_Adventure",
    "Set_Children",
    "Set_Comedy",
    "Set_Crime",
    "Set_Documentary"
  ],
  "visibleAttributes": [
    "ReleaseDate",
    "AvgRating",
    "Watches"
  ],
  "bookmarkedIntersections": [],
  "collapsed": [
    "Agg_Degree_0",
    "Agg_Degree_1",
    "Agg_Degree_1-Agg_Comedy",
    "Agg_Degree_2-Agg_Action",
    "Agg_Degree_2-Agg_Children",
    "Agg_Degree_3-Agg_Crime",
    "Agg_Degree_4"
  ],
  "plots": {
    "scatterplots": [],
    "histograms": [],
    "wordClouds": []
  }
}

Are there any additional TODOs before this PR is ready to go?

TODOs:

netlify[bot] commented 1 year ago

Deploy Preview for upset2 ready!

Name Link
Latest commit 5a73354c0ec0b72fc7466c8a68a28e2882ce0f6c
Latest deploy log https://app.netlify.com/sites/upset2/deploys/642215b222e6fa0008f4cd58
Deploy Preview https://deploy-preview-141--upset2.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

JakeWags commented 1 year ago

@filemon-mateus Note the change in grammar to include "collapsed". This is an array of strings which represent the aggregates which have been collapsed. If the aggregate is not in the array, then it is not collapsed.