bmabey/pyLDAvis

major LDAviz UI topic index bug (e.g. term, topic, etc.)

Closed this issue · 1 comments

I believe this is a high impact bug as it is not easy to notice, and can lead to incorrect interpretation, especially item 5.


Steps to reproduce

As of pyldavis==3.4.1, the bug should manifest itself as a minor UI bug (item 2,3), and data inconsistency (item 5).
It can be reproduced as follow:

  1. prepare a visualisation with start_index=0
  2. click topic 0
  3. hover other topic and observe that topic will never be set to color1 (~blue) again, stuck at color2 (~red)
  4. clicking other topic and observe same behaviour
  5. hover a term and observer radius of topic does not agree with data, in fact, they are off by 1.

Blame

This commit: 010cde0#diff-12750ebcae02c096cb6939beb54d0ab2353800555b8c01b00fae4fe93f376cfd

reverted some changes that are necessary for non-zero indexing to be functional:
f1cdb65#diff-ce28a7d983569ace041957292840319d65e2c6352989ae5f5556ae555e89404d


Solutions

The quickest and simplest fix is by reverting changes to all start_index related logic.

However, in the long run, we should probably decouple indexing logic with Topic labels, which will then allow renaming topics, which is sometimes requested by users.

To mitigate the issue, set start_index=1.