diff options
author | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-11-23 16:39:29 -0600 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-12-18 16:13:35 -0600 |
commit | 49bc458ad792a095c5ab5ebfc6b3cdf2f655bb92 (patch) | |
tree | 6b148b03b081853c15a4a721d6e30021514bd0ed /app | |
parent | 2ba30096d26174f22851feb8d35f287b8db772e3 (diff) | |
download | gitlab-ce-49bc458ad792a095c5ab5ebfc6b3cdf2f655bb92.tar.gz |
optimized d3 v4 with a custom made bundle
Diffstat (limited to 'app')
6 files changed, 46 insertions, 6 deletions
diff --git a/app/assets/javascripts/common_d3/index.js b/app/assets/javascripts/common_d3/index.js new file mode 100644 index 00000000000..f833e9840a0 --- /dev/null +++ b/app/assets/javascripts/common_d3/index.js @@ -0,0 +1,40 @@ +export { + select, + selectAll, +} from 'd3-selection'; + +export { + scaleLinear, + scaleTime, + scaleThreshold, +} from 'd3-scale'; + +export { + extent, + max, + bisector, +} from 'd3-array'; + +export { + timeFormat, + timeParse, +} from 'd3-time-format'; + +export { + line, + area, + curveLinear, +} from 'd3-shape'; + +export { + timeMinute, +} from 'd3-time'; + +export { + axisBottom, + axisLeft, +} from 'd3-axis'; + +export { + brush, +} from 'd3-brush'; diff --git a/app/assets/javascripts/graphs/stat_graph_contributors_graph.js b/app/assets/javascripts/graphs/stat_graph_contributors_graph.js index 9fbd0f110fb..a7c7d36e45f 100644 --- a/app/assets/javascripts/graphs/stat_graph_contributors_graph.js +++ b/app/assets/javascripts/graphs/stat_graph_contributors_graph.js @@ -13,7 +13,7 @@ import { area as d3Area, brush as d3Brush, timeParse as d3TimeParse, -} from 'd3'; +} from '../common_d3/index'; const extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; const hasProp = {}.hasOwnProperty; diff --git a/app/assets/javascripts/monitoring/components/graph.vue b/app/assets/javascripts/monitoring/components/graph.vue index 3e2c40a2546..b767c6957a6 100644 --- a/app/assets/javascripts/monitoring/components/graph.vue +++ b/app/assets/javascripts/monitoring/components/graph.vue @@ -7,7 +7,7 @@ max as d3Max, extent as d3Extent, select as d3Select, - } from 'd3'; + } from '../../common_d3/index'; import GraphLegend from './graph/legend.vue'; import GraphFlag from './graph/flag.vue'; import GraphDeployment from './graph/deployment.vue'; diff --git a/app/assets/javascripts/monitoring/utils/date_time_formatters.js b/app/assets/javascripts/monitoring/utils/date_time_formatters.js index 111b5f3b6f1..66f826a0e12 100644 --- a/app/assets/javascripts/monitoring/utils/date_time_formatters.js +++ b/app/assets/javascripts/monitoring/utils/date_time_formatters.js @@ -1,6 +1,6 @@ import { timeFormat as d3TimeFormat, - bisector } from 'd3'; + bisector } from '../../common_d3/index'; export const dateFormat = d3TimeFormat('%b %-d, %Y'); export const timeFormat = d3TimeFormat('%-I:%M%p'); diff --git a/app/assets/javascripts/monitoring/utils/multiple_time_series.js b/app/assets/javascripts/monitoring/utils/multiple_time_series.js index ab0e8d5f366..5161a0ffe67 100644 --- a/app/assets/javascripts/monitoring/utils/multiple_time_series.js +++ b/app/assets/javascripts/monitoring/utils/multiple_time_series.js @@ -1,3 +1,4 @@ +import _ from 'underscore'; import { scaleLinear as d3ScaleLinear, scaleTime as d3ScaleTime, @@ -7,8 +8,7 @@ import { max as d3Max, timeMinute as d3TimeMinute, curveLinear as d3CurveLinear, -} from 'd3'; -import _ from 'underscore'; +} from '../../common_d3/index'; const defaultColorPalette = { blue: ['#1f78d1', '#8fbce8'], diff --git a/app/assets/javascripts/users/activity_calendar.js b/app/assets/javascripts/users/activity_calendar.js index c888c67396a..9f25803e2f3 100644 --- a/app/assets/javascripts/users/activity_calendar.js +++ b/app/assets/javascripts/users/activity_calendar.js @@ -3,7 +3,7 @@ import { select as d3Select, scaleLinear as d3ScaleLinear, scaleThreshold as d3ScaleThreshold, -} from 'd3'; +} from '../common_d3/index'; import { getDayName, getDayDifference } from '../lib/utils/datetime_utility'; const LOADING_HTML = ` |