voyager icon indicating copy to clipboard operation
voyager copied to clipboard

updateData() can be wrongly ignored if you pass the same data object

Open happybeing opened this issue 5 years ago • 0 comments

Please:

  • [x] Check for duplicate issues
  • [x] Describe how to reproduce the bug / the goal of the new feature request

If you call voyagerInstance.updateData(someData) Voyager loads the data. If you repeat the call again with the same someData object nothing happens even if:

  • a different dataset has been loaded into Voyager via the 'Change' button in the Voyager UI
  • the data in the someData object is different from that in the preceding updateData(someData)

Workaround: Copy the someData to a new object before calling updateData(), for example:

const someData = { values: [...] };

function handleLoadButton () {
  // This works whether someData.values has changed or not
  const datatoload = { "values": [...someData.values] };
   voyagerInstance.updateData(datatoload);
}

happybeing avatar Feb 18 '20 17:02 happybeing