| OLD | NEW |
| 1 // | 1 // |
| 2 // Copyright 2014 Google Inc. All rights reserved. | 2 // Copyright 2014 Google Inc. All rights reserved. |
| 3 // | 3 // |
| 4 // Use of this source code is governed by a BSD-style | 4 // Use of this source code is governed by a BSD-style |
| 5 // license that can be found in the LICENSE file or at | 5 // license that can be found in the LICENSE file or at |
| 6 // https://developers.google.com/open-source/licenses/bsd | 6 // https://developers.google.com/open-source/licenses/bsd |
| 7 // | 7 // |
| 8 | 8 |
| 9 part of charted.charts; | 9 part of charted.charts; |
| 10 | 10 |
| 11 /// | 11 /// |
| 12 /// Interface to be implemented by data providers to give tabular access to | 12 /// Interface to be implemented by data providers to give tabular access to |
| 13 /// data for chart renderers. | 13 /// data for chart renderers. |
| 14 /// | 14 /// |
| 15 abstract class ChartData { | 15 abstract class ChartData { |
| 16 /// Read-only access to column specs | 16 /// Read-only access to column specs |
| 17 Iterable<ChartColumnSpec> get columns; | 17 Iterable<ChartColumnSpec> get columns; |
| 18 | 18 |
| 19 /// Read-only access to rows | 19 /// Read-only access to rows |
| 20 Iterable<List> get rows; | 20 Iterable<List> get rows; |
| 21 | 21 |
| 22 /// Create a new instance of [ChartData]'s internal implementation | 22 /// Create a new instance of [ChartData]'s internal implementation |
| 23 factory ChartData(Iterable<ChartColumnSpec> columns, | 23 factory ChartData(Iterable<ChartColumnSpec> columns, |
| 24 Iterable<Iterable> rows) = DefaultChartDataImpl; | 24 List<List> rows) = DefaultChartDataImpl; |
| 25 } | 25 } |
| 26 | 26 |
| 27 /// | 27 /// |
| 28 /// Interface implemented by [ChartData] transformers. | 28 /// Interface implemented by [ChartData] transformers. |
| 29 /// Examples: | 29 /// Examples: |
| 30 /// [AggregationTransformer] to compute aggregated rows/columns | 30 /// [AggregationTransformer] to compute aggregated rows/columns |
| 31 /// [FilterTransformer] to filter data | 31 /// [FilterTransformer] to filter data |
| 32 /// [TransposeTransformer] to convert rows to columns and vice-versa | 32 /// [TransposeTransformer] to convert rows to columns and vice-versa |
| 33 /// | 33 /// |
| 34 abstract class ChartDataTransform { | 34 abstract class ChartDataTransform { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 ChartColumnSpec( | 112 ChartColumnSpec( |
| 113 {this.label, | 113 {this.label, |
| 114 String type: TYPE_NUMBER, | 114 String type: TYPE_NUMBER, |
| 115 this.formatter, | 115 this.formatter, |
| 116 bool useOrdinalScale}) | 116 bool useOrdinalScale}) |
| 117 : useOrdinalScale = useOrdinalScale == true || | 117 : useOrdinalScale = useOrdinalScale == true || |
| 118 useOrdinalScale == null && ORDINAL_SCALES.contains(type), | 118 useOrdinalScale == null && ORDINAL_SCALES.contains(type), |
| 119 type = type; | 119 type = type; |
| 120 } | 120 } |
| OLD | NEW |