Giter Site home page Giter Site logo

d3-polymer-experiments's Introduction

Experiments with Polymer and D3

Polymer allows us to define custom html elements such as:

<todo-list>
	<todo-item></todo-item>
</todo-list>

D3 allows us to create and update the DOM in response to data changes.

Merging the two results in a very powerful way to manage a UI:

var todo = d3.select('todo-list').selectAll('todo-item').data(todos, function(d) {
	return d.id;
});
todo.enter().append('todo-item').attr('task', function(d) { return d; });
// where task is a complex object
// e.g.:
// { title: '', done: false, created: date }
// and data-bound by polymer after the attr call.

todo.exit().remove();

although data binding accomplishes much the same thing... is there really a use case for d3 here?

d3-polymer-experiments's People

Contributors

tantaman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

d3-polymer-experiments's Issues

Is there a use case here - +1 for that, there seems to be very many corners covered with D3

I came to this same conclusion a few months back. Looking into the D3 code I discovered a fine array of well written code that covers more appropriate ground than some frameworks do, with way more code re-use and cleverness that is hard to find in any library. Nothing short of an amazing piece of JS. Being SVG only is a slight drawback, for some - I personally think all UI should be SVG within a thin veil of HTML5 to give it semantics and whatn.

I have not explored too far into it since and I wonder if you have? and if so if you've any wisdom/conclusions to share...

I suspect with a few little D3 UI-centric plugins and sprinkles it would turn out to be a very fluid interface for live-edit mode (with gestures and physics why not?) UI builder and "framework". The way data cascades into place the way DOM was meant, but for visualization fits naturally with UI as UI is yet another, slightly more static form of Vis which is in my opinion the most important tech in the industry and there is a ton of dev/research into it because of this, and subsequently D3 is a refinement of code so beautiful it makes me weep (on the inside).

Sorry for submitting this as an "Issue" - feel free to close/whatever you need to in order for this not to affect repo stats.

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.