Giter VIP home page Giter VIP logo

Comments (18)

roccomuso avatar roccomuso commented on May 24, 2024

I could help with something but we should first split it in a separete module: #63

from webtorrent.io.

feross avatar feross commented on May 24, 2024

@roccomuso If you want to send improvements here first, I can publish it a separate module in a few days.

from webtorrent.io.

roccomuso avatar roccomuso commented on May 24, 2024

@feross I'm working on this features.
Here https://github.com/roccomuso/webtorrent-www/commit/2bbe5b02b3d2016ef2f7833cb440aece502b3476 the change of node color depending on seed/leech state. Is graph.seed('id', true/false); acceptable as API?

I've noticed also that the choke and unchoke methods need to be completed. Choking acts on the link and not on the node itself right? We could change the line color or something like that?

from webtorrent.io.

feross avatar feross commented on May 24, 2024

I think that API works!

I think making the line more transparent when we're choked would be good.

from webtorrent.io.

roccomuso avatar roccomuso commented on May 24, 2024

ok thanks for the tip, I'm on it right now... ;)

By the way I'm introducing a new dependency: https://github.com/avoidwork/filesize.js
It's a few lines browserified but provides a pratical way to show and work with transfer rate and byte size conversion.

from webtorrent.io.

feross avatar feross commented on May 24, 2024

@roccomuso We use prettier-bytes throughout the webtorrent projects. Please use that to avoid sending extra code to people's browsers 👍

from webtorrent.io.

roccomuso avatar roccomuso commented on May 24, 2024

@feross Alright, now using prettier-bytes.
Check out the new feature: show transfer rate between nodes (by changing thickness of line) - https://github.com/roccomuso/webtorrent-www/commit/0e67935bf0186ff7cc00ea4ef5cf488cbe7e7b00
The API is: graph.rate('Peer1', 'Peer2', 256 * 1000);, where the last param is a number expressed in bytes.

On the top of the lib in the COLORS variable I've defined some properties required to "map" the transfer rate to the line thickness.

from webtorrent.io.

feross avatar feross commented on May 24, 2024

Screenshot?

from webtorrent.io.

roccomuso avatar roccomuso commented on May 24, 2024

gifrecord_2016-09-19_114756

@feross As you can see the link gets thicker and thinner, changing every second his transfer rate to:

  1. 150 KB/s.
  2. 500 KB/s.
  3. 2.5 MB/s.
  4. 5 MB/s.
  5. 2.5 MB/s.
  6. 1 MB/s.

from webtorrent.io.

feross avatar feross commented on May 24, 2024

That's nice. Can you send a PR?

from webtorrent.io.

roccomuso avatar roccomuso commented on May 24, 2024

@feross yes sure. Couldn't be first splitted it in a separate module? So that I can write also the API documentation in a README.md.

from webtorrent.io.

feross avatar feross commented on May 24, 2024

Sure, I'll do that now and add you as GitHub collaborator and npm owner.

from webtorrent.io.

roccomuso avatar roccomuso commented on May 24, 2024

@feross thanks, let me know ;)

from webtorrent.io.

feross avatar feross commented on May 24, 2024

Okay, it's published as p2p-graph: https://github.com/feross/p2p-graph I added you to the repo/package.

from webtorrent.io.

feross avatar feross commented on May 24, 2024

Here's a PR to make webtorrent-www use p2p-graph: #105

from webtorrent.io.

roccomuso avatar roccomuso commented on May 24, 2024

ok, I think you can merge the PR. I'm gonna push directly on the p2p-graph repo.

from webtorrent.io.

feross avatar feross commented on May 24, 2024

@roccomuso Nice. Please still send PRs to the p2p-graph repo so there's a chance for other contributors and I to give feedback before merging.

from webtorrent.io.

roccomuso avatar roccomuso commented on May 24, 2024

@feross ok cool! I've sent the PR.

from webtorrent.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.