Skip to content

Commit

Permalink
Merge pull request #49 from nikolaswise/master
Browse files Browse the repository at this point in the history
rando ids
  • Loading branch information
ungoldman committed Nov 10, 2014
2 parents 7cb4adc + 5010c2e commit a1b6dac
Show file tree
Hide file tree
Showing 5 changed files with 579 additions and 18 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Angular-Dimple Changelog

## v.1.1.4
* Fix bug that caused smooshed graphs on Firefox

## v1.1.3
* rebuild site
* add `color` attribute on graph.js
Expand Down
5 changes: 2 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ module.exports = function(grunt) {
'compress': {
main: {
options: {
archive: repo + '.zip'
archive: name + '.zip'
},
files: [
{
Expand Down Expand Up @@ -179,8 +179,7 @@ module.exports = function(grunt) {
release: {
tag_name: currentVersion,
name: currentVersion,
body: description,
prerelease: true
body: description
}
},
files: {
Expand Down
23 changes: 9 additions & 14 deletions lib/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,20 @@ angular.module('angular-dimple.graph', [])
controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {
var chart;

var id = (Math.random() * 1e9).toString(36).replace(".", "_");
$element.append('<div class="dimple-graph" id="dng-'+ id +'"></div>');

this._createChart = function () {
// create an svg element
var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
if ($attrs.width) {
svg.setAttribute('width', $attrs.width);
} else {
svg.setAttribute('width', '100%');
}
if ($attrs.height) {
svg.setAttribute('height', $attrs.height);
} else {
svg.setAttribute('height', '100%');
}

// end the svg to this <graph>
$element.append(svg);
var width = $attrs.width ? $attrs.width : '100%';
var height = $attrs.height ? $attrs.height : '100%';

var svg = dimple.newSvg('#dng-'+ id +'', width, height);
var data = $scope.data;

// create the dimple chart using the d3 selection of our <svg> element
chart = new dimple.chart(d3.select(svg));
chart = new dimple.chart(svg, data);

if ($attrs.margin) {
chart.setMargins($attrs.margin);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-dimple",
"version": "1.1.3",
"version": "1.1.4",
"description": "Angular.js wrapper for the Dimple charting language",
"repository": "https://github.com/esripdx/angular-dimple",
"license": "ISC",
Expand Down
Loading

0 comments on commit a1b6dac

Please sign in to comment.