Giter Club home page Giter Club logo

Comments (8)

benlesh avatar benlesh commented on July 16, 2024

percentage based dimensions for? The nf-graph container itself?

from ember-nf-graph.

miguelmota avatar miguelmota commented on July 16, 2024

Yeah for the nf-graph component, instead of pixel based width/height

from ember-nf-graph.

benlesh avatar benlesh commented on July 16, 2024

So this is tricky.

The pixel values passed to width and height are used to calculate the scale of the graphed elements. In order to get those, I'd need to check to see if what was passed happened to be a string ending with "%", then setup an event to detect when the SVG has resized. ... that's where this gets tricky. The only reliable way I know of to get when the SVG has been resized is to poll repeatedly and check it's computed size. This is because while a document resize event will help, it's not the only way to resize the parents of the SVG of the nf-graph component. If any DOM parent of the SVG element is updated, it will resize the SVG, and we need to know. Unfortunately there isn't a great event for that. MutationObservers may help, but aren't reliable in every browser, and may have performance implications... So I'd want to set them up only when the size was set to a percentage, and tear them down otherwise.

from ember-nf-graph.

benlesh avatar benlesh commented on July 16, 2024

I'm not saying we're definitely not going to implement this. In fact, it might even end up being a requirement for the project this was birthed from. I'm really saying that this is a non-trivial change that could end up being buggy or slow on some platforms.

from ember-nf-graph.

benlesh avatar benlesh commented on July 16, 2024

I'm adding wontfix to this and closing it, for now.

BUT I will keep this in mind because it's likely to come up on our app here.

from ember-nf-graph.

miguelmota avatar miguelmota commented on July 16, 2024

@Blesh I figured that would be case. Basically all the work would have to be invoked after the node is inserted in the DOM. Thanks anyway!

from ember-nf-graph.

ming-codes avatar ming-codes commented on July 16, 2024

This could be the solution: EmberSherpa/ember-element-resize-detector

from ember-nf-graph.

benlesh avatar benlesh commented on July 16, 2024

@ming-codes as I recall, we used something like that to handle resizing these components at Netflix

from ember-nf-graph.

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.