unchartedelixir / uncharted

33 stars 8 forks source link

Bugfix/fix dataset titles #56

Open Stamates opened 2 years ago

Stamates commented 2 years ago

Add labels to the data in the accessibility tables.

Stamates commented 2 years ago

@tmecklem I added labels for the data tables using a protocol built for the dataset. My thoughts...

  1. I feel like the code would be cleaner if I just added the data_name_label and data_value_label functions to the Uncharted.Chart protocol (then I could just use @chart in the templates instead of @chart.dataset). However, I wasn't really sure if data labels was a "chart" level concept (like title) since it's dealing with the data and I wasn't sure if there'd be situations with multiple datasets (plotting on secondary y-axis) that would further complicate things.
  2. It feels like there should be a dataset implementation for the Uncharted.Chart protocol. I see a lot of places where we're dot deconstructing from a protocol implementation (ex. @chart.dataset...) where it seems like this is defeating some of the purpose of using protocols (avoid Law of Demeter violations).

Let me know when you get 20-30 mins to chat about this.

rheubach commented 2 years ago

@Stamates I think you are right we created data sets that were linked to a table this would be more flexible to be applied to more types of charts.