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 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 /// Factory method to create an instance of the default implementation | 51 /// Factory method to create an instance of the default implementation |
52 /// - [host] must be an Element that has clientHeight and clientWidth | 52 /// - [host] must be an Element that has clientHeight and clientWidth |
53 /// properties defined (i.e cannot be inline elements) | 53 /// properties defined (i.e cannot be inline elements) |
54 /// - [data] is an instance of [ChartData] | 54 /// - [data] is an instance of [ChartData] |
55 /// - [config] is an implementation of [ChartConfig] | 55 /// - [config] is an implementation of [ChartConfig] |
56 /// - If [autoUpdate] is set, chart is updated when data or config | 56 /// - If [autoUpdate] is set, chart is updated when data or config |
57 /// change. When not set, [draw] must be called to update the chart. | 57 /// change. When not set, [draw] must be called to update the chart. |
58 /// - When [useTwoDimensionAxes] is set, the chart uses both 'x' and 'y' | 58 /// - When [useTwoDimensionAxes] is set, the chart uses both 'x' and 'y' |
59 /// axes as dimensions. | 59 /// axes as dimensions. |
60 factory CartesianArea( | 60 factory CartesianArea(dynamic host, ChartData data, ChartConfig config, |
61 dynamic host, | 61 {bool autoUpdate: false, |
62 ChartData data, | 62 bool useTwoDimensionAxes: false, |
63 ChartConfig config, { | 63 bool useRowColoring: false, |
64 bool autoUpdate: false, | 64 ChartState state}) => |
65 bool useTwoDimensionAxes: false, | 65 new DefaultCartesianAreaImpl(host, data, config, autoUpdate, |
66 bool useRowColoring: false, | 66 useTwoDimensionAxes, useRowColoring, state); |
67 ChartState state }) => | |
68 new DefaultCartesianAreaImpl(host, data, config, autoUpdate, | |
69 useTwoDimensionAxes, useRowColoring, state); | |
70 } | 67 } |
71 | 68 |
72 /// | 69 /// |
73 /// Area for rendering layout charts. A layout chart creates visualization by | 70 /// Area for rendering layout charts. A layout chart creates visualization by |
74 /// distributing available space to each measure. | 71 /// distributing available space to each measure. |
75 /// | 72 /// |
76 /// For example: | 73 /// For example: |
77 /// - A pie-chart distributes a radial area to each measure. | 74 /// - A pie-chart distributes a radial area to each measure. |
78 /// - In a tree-map a rectangular area is distributed to each measure. | 75 /// - In a tree-map a rectangular area is distributed to each measure. |
79 /// | 76 /// |
80 /// In a [LayoutArea], only one series can be rendered and the area does | 77 /// In a [LayoutArea], only one series can be rendered and the area does |
81 /// not have any scales and axes. | 78 /// not have any scales and axes. |
82 /// | 79 /// |
83 abstract class LayoutArea implements ChartArea { | 80 abstract class LayoutArea implements ChartArea { |
84 /// Layout area always uses row coloring. | 81 /// Layout area always uses row coloring. |
85 bool get useRowColoring => true; | 82 bool get useRowColoring => true; |
86 | 83 |
87 factory LayoutArea( | 84 factory LayoutArea(dynamic host, ChartData data, ChartConfig config, |
88 dynamic host, | 85 {bool autoUpdate: false, ChartState state}) => |
89 ChartData data, | 86 new DefaultLayoutAreaImpl(host, data, config, autoUpdate, state); |
90 ChartConfig config, { | |
91 bool autoUpdate: false, | |
92 ChartState state }) => | |
93 new DefaultLayoutAreaImpl(host, data, config, autoUpdate, state); | |
94 } | 87 } |
95 | 88 |
96 /// | 89 /// |
97 /// Base interface for all implementations of a chart drawing area. | 90 /// Base interface for all implementations of a chart drawing area. |
98 /// | 91 /// |
99 abstract class ChartArea implements ChartAreaBehaviorSource { | 92 abstract class ChartArea implements ChartAreaBehaviorSource { |
100 /// Data used by the chart. Chart isn't updated till the next call to | 93 /// Data used by the chart. Chart isn't updated till the next call to |
101 /// draw function if [autoUpdate] is set to false. | 94 /// draw function if [autoUpdate] is set to false. |
102 /// | 95 /// |
103 /// Setting new value to [data] will update chart if [autoUpdate] is set. | 96 /// Setting new value to [data] will update chart if [autoUpdate] is set. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 /// Sizes of axes by orientation. | 149 /// Sizes of axes by orientation. |
157 /// Only valid on [CartesianArea], null otherwise. | 150 /// Only valid on [CartesianArea], null otherwise. |
158 Map<String, Rect> get axes; | 151 Map<String, Rect> get axes; |
159 | 152 |
160 /// Size of render area. | 153 /// Size of render area. |
161 Rect get renderArea => new Rect(); | 154 Rect get renderArea => new Rect(); |
162 | 155 |
163 /// Size of chart area. | 156 /// Size of chart area. |
164 Rect get chartArea => new Rect(); | 157 Rect get chartArea => new Rect(); |
165 } | 158 } |
OLD | NEW |