Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5382)

Unified Diff: charted/lib/charts/src/chart_config_impl.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « charted/lib/charts/src/chart_axis_impl.dart ('k') | charted/lib/charts/src/chart_data_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: charted/lib/charts/src/chart_config_impl.dart
diff --git a/charted/lib/charts/src/chart_config_impl.dart b/charted/lib/charts/src/chart_config_impl.dart
deleted file mode 100644
index e77057cd1bd91b169fbc063edfb0d9248adbcdd6..0000000000000000000000000000000000000000
--- a/charted/lib/charts/src/chart_config_impl.dart
+++ /dev/null
@@ -1,135 +0,0 @@
-//
-// Copyright 2014 Google Inc. All rights reserved.
-//
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file or at
-// https://developers.google.com/open-source/licenses/bsd
-//
-
-part of charted.charts;
-
-class DefaultChartConfigImpl extends ChangeNotifier implements ChartConfig {
- final Map<String,ChartAxisConfig> _measureAxisRegistry = {};
- final Map<int,ChartAxisConfig> _dimensionAxisRegistry = {};
- final SubscriptionsDisposer _disposer = new SubscriptionsDisposer();
-
- bool _isRTL = false;
- Iterable<ChartSeries> _series;
- Iterable<int> _dimensions;
- StreamSubscription _dimensionsSubscription;
-
- @override
- Rect minimumSize = const Rect.size(400, 300);
-
- @override
- bool isLeftAxisPrimary = false;
-
- @override
- bool autoResizeAxis = true;
-
- @override
- ChartLegend legend;
-
- @override
- Iterable<String> displayedMeasureAxes;
-
- @override
- bool renderDimensionAxes = true;
-
- @override
- bool switchAxesForRTL = true;
-
- DefaultChartConfigImpl(Iterable<ChartSeries> series, Iterable<int> dimensions) {
- this.series = series;
- this.dimensions = dimensions;
- }
-
- @override
- set series(Iterable<ChartSeries> values) {
- assert(values != null && values.isNotEmpty);
-
- _disposer.dispose();
- _series = values;
- notifyChange(const ChartConfigChangeRecord());
-
- // Monitor each series for changes on them
- values.forEach((item) {
- if (item is Observable) {
- _disposer.add(item.changes.listen(
- (_) => notifyChange(const ChartConfigChangeRecord())), item);
- }
- });
-
- // Monitor series for changes. When the list changes, update
- // subscriptions to ChartSeries changes.
- if (_series is ObservableList) {
- var observable = _series as ObservableList;
- _disposer.add(observable.listChanges.listen((records) {
- records.forEach((record) {
- record.removed.forEach((value) => _disposer.unsubscribe(value));
- for (int i = 0; i < record.addedCount; i++) {
- var added = observable[i + record.index];
- _disposer.add(added.changes.listen(
- (_) => notifyChange(const ChartConfigChangeRecord())));
- }
- });
- notifyChange(const ChartConfigChangeRecord());
- }));
- }
- }
-
- @override
- Iterable<ChartSeries> get series => _series;
-
- @override
- set dimensions(Iterable<int> values) {
- _dimensions = values;
-
- if (_dimensionsSubscription != null) {
- _dimensionsSubscription.cancel();
- _dimensionsSubscription = null;
- }
-
- if (values == null || values.isEmpty) return;
-
- if (_dimensions is ObservableList) {
- _dimensionsSubscription =
- (_dimensions as ObservableList).listChanges.listen(
- (_) => notifyChange(const ChartConfigChangeRecord()));
- }
- }
-
- @override
- Iterable<int> get dimensions => _dimensions;
-
- @override
- void registerMeasureAxis(String id, ChartAxisConfig config) {
- assert(config != null);
- _measureAxisRegistry[id] = config;
- }
-
- @override
- ChartAxisConfig getMeasureAxis(String id) => _measureAxisRegistry[id];
-
- @override
- void registerDimensionAxis(int column, ChartAxisConfig config) {
- assert(config != null);
- assert(dimensions.contains(column));
- _dimensionAxisRegistry[column] = config;
- }
-
- @override
- ChartAxisConfig getDimensionAxis(int column) =>
- _dimensionAxisRegistry[column];
-
- @override
- set isRTL(bool value) {
- if (_isRTL != value && value != null) {
- _isRTL = value;
- notifyChange(const ChartConfigChangeRecord());
- }
- }
-
- @override
- bool get isRTL => _isRTL;
-}
« no previous file with comments | « charted/lib/charts/src/chart_axis_impl.dart ('k') | charted/lib/charts/src/chart_data_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698