Giter VIP home page Giter VIP logo

d3-bootstrap's Introduction

Hey, I'm Shawn ๐Ÿ‘‹

  • I'm a web nerd doing my best to improve digital services for the City of San Francisco.
  • I'm a dad with two awesome boys.
  • I like bicycles and synthesizers.
  • Black lives matter.

d3-bootstrap's People

Contributors

jfirebaugh avatar paul-english avatar shawnbot avatar tmcw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

d3-bootstrap's Issues

Where to store per-element state? (bootstrap-typeahead)

Hi Shawn, and CC @mbostock,

As you may know, @tmcw and I are using d3-bootstrap components in iD. Right now we have a home-grown typeahead component, and I was looking into generalizing it for inclusion in d3-bootstrap. However, it's not clear to me how to translate some of the bootstrap idioms to d3, and I wanted to see if you had any thoughts.

bootstrap-typeahead uses $.fn.data to store a per-element Typeahead instance which implements the necessary state and behavior. For typeahead, this includes most importantly a reference (this.$menu) to the ul element that displays the typeahead results. Imagine implementing for d3-bootstrap-typeahead a typeahead.close(selection) function -- it needs to hide the menu element corresponding to each element in the selection.

In d3, per-element state is normally either part of the datum or manifested in the local variables of a element-specific closure. Neither of those are suitable in this case: for reusable components like typeahead, the data need to be reserved for user purposes. And closures provide no way of obtaining the state given only a selection or element.

Alternatives:

  • Store data in DOM element properties. This appears to be what existing boostrap-d3 components do. Simple, but introduces risks of name collision, and leads one towards an un-d3-ish classical Typeahead prototype.
  • Materialize all state in the DOM such that it can be recalculated later. For instance, finding the typeahead menu based on DOM traversal or sub-selection. Awkward and error-prone in some cases.
  • Create a per-element data side-channel akin to $.fn.data. This also boils down to DOM element properties, but perhaps in a more maintainable way.

That's a very brief summary of the issues so let me know if it is unclear. Otherwise, any thoughts?

Getting Object #<Object> has no method 'tooltip' error

I am trying to use d3-popover on a map I am rendering using d3. Here are my script includes:

<script src="js/d3.v3.min.js"></script> <script src="js/d3-compat.js"></script> <script src="js/bootstrap-popover.js"></script>

At the appropriate time I invoke:
d3.selectAll(".desired")
.call( d3.tooltip().placement("right") );

At this point, the chrome console displays a typeerror with the message: "Object # has no method 'popover'"

I could not find any help on the internet. I also thought it was an issue with d3.v3 since your examples use d3.v2, but even when using v2 I get the typeerror.

Any ideas?

Thank you.

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.