question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot re-initialize scatter for a second time with the extension version

See original GitHub issue

I know the extension version is not recommended using any longer, but something wrong when trying to re-initialize scatter for a better network connection.

screen shot 2019-02-27 at 10 02 40 am

    "eosjs": "^16.0.9",
    "scatterjs-core": "^2.7.14",
    "scatterjs-plugin-eosjs": "^1.5.1"
const network = [{...}, {...}]

const initScatter = index => {
  console.log('init start');
  ScatterJS.scatter.connect('APP_NAME').then(connected => {
    console.log('something wrong here');
    if (!connected) {
      return false;
    }
    ScatterJS.scatter.eos(network[index], Eos);
    return true;
  });
};

initScatter(0)

document.getElementById('networkIndexSelection').addEventListener('change', e => {
  const index = e.currentTarget.value;
  document.getElementById('networkIndex').innerHTML = index;
  initScatter(index);
});

when I tried to change the index to re-initialize the scatter, occurs Extension.js:1 Uncaught (in promise) TypeError: Cannot read property 'get' of undefined

Ony with the EXTENSION version.

https://github.com/edwardfhsiao/scatter-test-repo

npm i

then

npm run server

0.0.0.0:3000

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
edwardfxiaocommented, Mar 6, 2019

Okay, now I understand. Thank you @nsjames

1reaction
nsjamescommented, Mar 6, 2019
const network = [{...}, {...}]

let connected = false;
let eos;
ScatterJS.scatter.connect('APP_NAME').then(c=> {
    connected = c;
    if (!connected) {
      return false;
    }

    initScatter(0);
});

const initScatter = index => {

    eos = ScatterJS.scatter.eos(network[index], Eos);
    return true;
};

document.getElementById('networkIndexSelection').addEventListener('change', e => {
  const index = e.currentTarget.value;
  document.getElementById('networkIndex').innerHTML = index;
  initScatter(index);
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

plotly.scatter figure doesnt reset when updating with callback ...
Here are some advises to your code, to avoid this behaviour. Use Dash built-in debugger to see what is inside the callbacks. It...
Read more >
Troubleshooting in Python - Plotly
If you are encountering problems using plotly with Dash please first ensure that you have upgraded dash to the latest version, which will...
Read more >
gnuplot documentation
Time coordinates are stored internally as the number of seconds relative to the standard unix epoch 1-. Jan-1970. Earlier versions of gnuplot used...
Read more >
Futures - Dask documentation
Dask supports a real-time task framework that extends Python's ... Scattering moves your data to a worker and returns a future pointing to...
Read more >
Chapter 4. Visualization with Matplotlib - O'Reilly
plot is that it can be used to create scatter plots where the properties of each individual point (size, face color, edge color,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found