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

Unified Diff: packages/charted/lib/charts/chart_data.dart

Issue 1521693002: Roll Observatory deps (charted -> ^0.3.0) (Closed) Base URL: https://chromium.googlesource.com/external/github.com/dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years 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 | « packages/charted/lib/charts/chart_config.dart ('k') | packages/charted/lib/charts/chart_legend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/charted/lib/charts/chart_data.dart
diff --git a/packages/charted/lib/charts/chart_data.dart b/packages/charted/lib/charts/chart_data.dart
index f6304c03e34ef5cdfaa48ad70c00d15d0f95206e..de58dbc8f4dc0b8b95faee9cb3b3b6586033dbf7 100644
--- a/packages/charted/lib/charts/chart_data.dart
+++ b/packages/charted/lib/charts/chart_data.dart
@@ -20,8 +20,8 @@ abstract class ChartData {
Iterable<Iterable> get rows;
/// Create a new instance of [ChartData]'s internal implementation
- factory ChartData(
- Iterable<ChartColumnSpec> columns, Iterable<Iterable> rows) = DefaultChartDataImpl;
+ factory ChartData(Iterable<ChartColumnSpec> columns,
+ Iterable<Iterable> rows) = DefaultChartDataImpl;
}
///
@@ -37,7 +37,6 @@ abstract class ChartDataTransform {
ChartData transform(ChartData source);
}
-
///
/// Implementation of [ChangeRecord], that is used to notify when rows get added
/// or removed to ChartData
@@ -74,9 +73,9 @@ class ChartColumnSpec {
static const String TYPE_STRING = 'string';
static const String TYPE_TIMESTAMP = 'timestamp';
- static const List ORDINAL_SCALES = const [ TYPE_STRING ];
- static const List LINEAR_SCALES = const [ TYPE_NUMBER ];
- static const List TIME_SCALES = const [ TYPE_DATE, TYPE_TIMESTAMP ];
+ static const List ORDINAL_SCALES = const [TYPE_STRING];
+ static const List LINEAR_SCALES = const [TYPE_NUMBER];
+ static const List TIME_SCALES = const [TYPE_DATE, TYPE_TIMESTAMP];
/// Formatter for values that belong to this column
final FormatFunction formatter;
@@ -102,20 +101,20 @@ class ChartColumnSpec {
Scale createDefaultScale() {
if (useOrdinalScale == true) {
return new OrdinalScale();
- }
- else if (LINEAR_SCALES.contains(type)) {
+ } else if (LINEAR_SCALES.contains(type)) {
return new LinearScale();
- }
- else if (TIME_SCALES.contains(type)) {
+ } else if (TIME_SCALES.contains(type)) {
return new TimeScale();
}
return null;
}
- ChartColumnSpec({this.label, String type : TYPE_NUMBER,
- this.formatter, bool useOrdinalScale})
- : useOrdinalScale =
- useOrdinalScale == true ||
+ ChartColumnSpec(
+ {this.label,
+ String type: TYPE_NUMBER,
+ this.formatter,
+ bool useOrdinalScale})
+ : useOrdinalScale = useOrdinalScale == true ||
useOrdinalScale == null && ORDINAL_SCALES.contains(type),
type = type;
}
« no previous file with comments | « packages/charted/lib/charts/chart_config.dart ('k') | packages/charted/lib/charts/chart_legend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698