ipysankeywidget icon indicating copy to clipboard operation
ipysankeywidget copied to clipboard

Example 4: Colour-intensity scales appears to be broken

Open JoeyBream opened this issue 3 years ago • 0 comments

Hi, there appears to be an issue with the fourth example. It returns the following error when it attempts to weave a diagram.

KeyError                                  Traceback (most recent call last)
<ipython-input-10-df348d8752fe> in <module>
      4 
      5 sdd = SankeyDefinition(nodes, bundles, ordering)
----> 6 weave(sdd, dataset, measures='Calories Burnt').to_widget(**size_options)

/srv/conda/envs/notebook/lib/python3.7/site-packages/floweaver/sankey_data.py in to_widget(self, width, height, margins, align_link_types, link_label_format, link_label_min_width, debugging)
     80             }
     81 
---> 82         value = self.to_json(format="widget")
     83         widget = SankeyWidget(
     84             nodes=value["nodes"],

/srv/conda/envs/notebook/lib/python3.7/site-packages/floweaver/sankey_data.py in to_json(self, filename, format)
     35             data = {
     36                 "nodes": [n.to_json(format) for n in self.nodes],
---> 37                 "links": [l.to_json(format) for l in self.links],
     38                 "order": self.ordering.layers,
     39                 "groups": self.groups,

/srv/conda/envs/notebook/lib/python3.7/site-packages/floweaver/sankey_data.py in <listcomp>(.0)
     35             data = {
     36                 "nodes": [n.to_json(format) for n in self.nodes],
---> 37                 "links": [l.to_json(format) for l in self.links],
     38                 "order": self.ordering.layers,
     39                 "groups": self.groups,

/srv/conda/envs/notebook/lib/python3.7/site-packages/floweaver/sankey_data.py in to_json(self, format)
    180                 "type": self.type,
    181                 "time": self.time,
--> 182                 "value": self.data["value"],
    183                 "title": self.title,
    184                 "color": self.color,

KeyError: 'value'

Do you have any ideas what the problem might be? I really enjoy this package and would appreciate the opportunity to know it better.

JoeyBream avatar Jan 20 '22 12:01 JoeyBream