Coder Social home page Coder Social logo

Comments (4)

ahmadsoe avatar ahmadsoe commented on July 18, 2024

You can use {{component}} helper to render component dynamically.

{{component selectedChart chartOptions=chartOptions .... }}

more info about this helper is here http://emberjs.com/api/classes/Ember.Templates.helpers.html#method_component

from ember-highcharts.

denchen avatar denchen commented on July 18, 2024

Thanks. What I ended up doing is using the component helper to initially render an empty component, and then when selectedChart is set to non-null, I render my dynamic-high-chart component. Probably not that elegant or even the proper way to do things, but it works.

That being said, I'm still a little confused as to how Ember components get rendered / re-rendered. Let's say I have a chart already rendered. But then I completely replace chartData that's bound to content. Shouldn't the entire component be re-rendered, according to this:

http://emberjs.com/blog/2015/05/24/another-two-oh-status-update.html#toc_new-lifecycle-hooks

If that is the case, and the entire component is re-rendered, why do we need the contentDidChange() function that's in the example in the README, since the chart gets re-created anyway? Or am I completely misunderstanding what "rerendering" in Ember actually is? (My take on it is the component (HighCharts) is destroyed and re-created with the new attributes)

from ember-highcharts.

ahmadsoe avatar ahmadsoe commented on July 18, 2024

Updating chartData that's bound to content will not re-render the entire component, it just to update the chart series (like x or y values).
The contentDidChange() in the readme is for a special case if you want to also update another chart properties (e.g. chart title, sub-title, axis label) via HighCharts API.

from ember-highcharts.

gregjopa avatar gregjopa commented on July 18, 2024

This questions seems to be answered. I think this issue can be closed.

from ember-highcharts.

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.