app.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //var tb_parent = $('#toolbar')
  2. var tb_parent = $('<div id="toolbar"></div>').appendTo($(document.documentElement));
  3. tb_parent.w2toolbar({
  4. name: 'toolbar',
  5. items: [
  6. { type: 'check', id: 'item1', caption: 'Check', img: 'icon-page', checked: true },
  7. { type: 'break', id: 'break0' },
  8. { type: 'menu', id: 'item2', caption: 'Drop Down', img: 'icon-folder', items: [
  9. { text: 'Item 1', icon: 'icon-page' },
  10. { text: 'Item 2', icon: 'icon-page' },
  11. { text: 'Item 3', value: 'Item Three', icon: 'icon-page' }
  12. ]},
  13. { type: 'break', id: 'break1' },
  14. { type: 'radio', id: 'item3', group: '1', caption: 'Radio 1', icon: 'fa-star', checked: true },
  15. { type: 'radio', id: 'item4', group: '1', caption: 'Radio 2', icon: 'fa-star-empty' },
  16. { type: 'spacer' },
  17. { type: 'button', id: 'item5', caption: 'Item 5', icon: 'fa-home' }
  18. ],
  19. onClick: function(event) {
  20. console.log(event.target);
  21. }
  22. });
  23. var data = [4, 8, 15, 16, 23, 42];
  24. d3.select("#debugging_view")
  25. .html("Hello World!");
  26. var x = d3.scale.linear()
  27. .domain([0, d3.max(data)])
  28. .range([0, 420]);
  29. d3.select("#debugging_view")
  30. .selectAll("div")
  31. .data(data)
  32. .enter().append("div")
  33. .style("width", function(d) { return x(d) + "px"; })
  34. .style("background-color", "steelblue")
  35. .style("padding", "3px")
  36. .style("margin", "1px")
  37. .text(function(d) { return d; });