wjbmattingly / LeetTopic

53 stars 5 forks source link

add leet_labels column on initial s2 creation #5

Closed joelsjlee closed 1 year ago

joelsjlee commented 1 year ago
 ERROR:bokeh.core.validation.check:E-1001 (BAD_COLUMN_NAME): Glyph refers to nonexistent column name. This could either be due to a misspelling or typo, or due to an expected column being missing. : key "fill_color" value "leet_labels", key "hatch_color" value "leet_labels", key "line_color" value "leet_labels" [renderer: GlyphRenderer(id='2403', ...)]

I was able to resolve the error/warning being thrown. Essentially, we assign the color in the GlyphRenderer scatter2 to a mapper object we create. The cmap mapper we create needs a field_name assigned to know from which column to assign the colors. From what I understand, Bokeh wants that field_name to exist in the Column Data Source (s2) when the mapper is assigned, so all we need to do is assign it to an empty list when its created. From some of the last lines of the code, we assign the topic_field (and thereby the field_name in the get_color_mapping) to "leet_labels". Let me know if this resolves the issue on your end and is also a good solution based on how things are implemented. I tested it and I don't think this affects any of the functionality of the program. I also removed some unnecessary commented out code.

wjbmattingly commented 1 year ago

Joel, this is fantastic! Thanks for debugging this. I have gone ahead and accepted it and committed this to 0.0.9 branch. commit