Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
GitHub Sync (#605)
Browse files Browse the repository at this point in the history
* Internal changes

PiperOrigin-RevId: 298455490

* Internal changes

PiperOrigin-RevId: 299212474

* Internal changes

PiperOrigin-RevId: 299384685

* Internal changes

PiperOrigin-RevId: 299911795

* Apply sort_child_properties_last lint so we can enable it in google3.

This enhances readability in *majority* of the cases by moving properties of a widget to the top. See: https://dart-lang.github.io/linter/lints/sort_child_properties_last.html

Tested:
    TAP --sample ran all affected tests and none failed
    http://test/OCL:300415528:BASE:300394685:1583970262840:214ae086
PiperOrigin-RevId: 300472053

* Internal changes

PiperOrigin-RevId: 300583916

* Internal changes

PiperOrigin-RevId: 301253904

* Internal changes

PiperOrigin-RevId: 301413179

* Correct the point location computation to be inside of scale's range if it is outside of scale range but only outside by less than epsilon in order to avoid potential mislocation caused by floating point computation.

PiperOrigin-RevId: 301644128

* Internal changes

PiperOrigin-RevId: 301919359

* Internal changes

PiperOrigin-RevId: 305070616

* Point renderer has now the option to select all points overlapping the interaction point

PiperOrigin-RevId: 306413187

* Internal Changes

PiperOrigin-RevId: 306960748

* Fix missing_return errors for anonymous closures.

These are mostly closures whose type dictates that a Future of something-or-other be returned. Fixes include:

* Make the closure async
* Add a return statement

Tested:
    TAP for global presubmit queue
    http://test/OCL:307493015:BASE:307542828:1587474095828:2c1a77e8
PiperOrigin-RevId: 308003343

* Internal change

PiperOrigin-RevId: 308058514

* Allow using up/down arrow keys to change the hovered bar in a chart. Also add preventDefault so the page doesn't scroll.

PiperOrigin-RevId: 308932972

* Internal change

PiperOrigin-RevId: 309073218

* Internal changes

PiperOrigin-RevId: 309494957

* Add TriangleSymbolRenderer

PiperOrigin-RevId: 310472091

* Expose additional classes

PiperOrigin-RevId: 310943783

* Change MaterialGray shade900 from blue to correct gray

PiperOrigin-RevId: 311587781

* Pass `DateTimeFactory` to `TimeSeriesChart`

PiperOrigin-RevId: 311764962

* Add setting to allow series to be always visible and unclickable in the chart legend.

PiperOrigin-RevId: 314159954

* Export additional classes

PiperOrigin-RevId: 314565994

* Add custom legend ordering by sorting the behaviors series list based on a list with ordered series IDs.

PiperOrigin-RevId: 315910283

* Add custom axis renderer for range ticks.

PiperOrigin-RevId: 315976899

* Internal changes.

PiperOrigin-RevId: 318221788

* Set datum index for legend entry

PiperOrigin-RevId: 319291348

* Internal changes

PiperOrigin-RevId: 322200941

* Internal changes

PiperOrigin-RevId: 322451897

* Internal changes.

PiperOrigin-RevId: 322661249

* Internal changes

PiperOrigin-RevId: 322671049

* Internal changes

PiperOrigin-RevId: 322827055

* Override setState fn with mounted check in baseChartState.

PiperOrigin-RevId: 325307554

* Internal changes

PiperOrigin-RevId: 326067746

* Internal changes

PiperOrigin-RevId: 328177790

* Internal changes

PiperOrigin-RevId: 331718263

* Internal changes

PiperOrigin-RevId: 331738992

* Internal changes

PiperOrigin-RevId: 331765706

* Automated g4 rollback of changelist 331765706.

*** Reason for rollback ***

Manually rolled back on behalf of: oreflow.
Reason Given: This CL auto rolled back a rollback. Rolling forward to a broken revision

*** Original change description ***

Automated g4 rollback of changelist 331738992.

*** Reason for rollback ***

TAP has detected 10 or more targets failed to build at cl/331738992.

TO ROLLFORWARD (without additional approval): Use go/undo-autorollback and consider filing a go/autorollback-bug.

To see all broken targets visit http://test/331738992 or go/newly-broken?p=cl:331738992 if the former is slow to load.
To prevent noise from flakes, TAP double-checked the following target fails to build:
https://sponge.corp.google.com/in...

***

PiperOrigin-RevId: 331767278

* Internal changes

PiperOrigin-RevId: 336974207

* Internal changes

PiperOrigin-RevId: 337212864

* Test-only change to prepare for new Flutter version

PiperOrigin-RevId: 339319134

* Internal changes

PiperOrigin-RevId: 340251505

* Internal changes

PiperOrigin-RevId: 340463455

* Internal changes

PiperOrigin-RevId: 340658840

* Internal changes

PiperOrigin-RevId: 342347503

* Internal changes

PiperOrigin-RevId: 345724352

* Internal changes

PiperOrigin-RevId: 347872889

* Internal changes

PiperOrigin-RevId: 350249482

* Clean up violations of Dart lint unnecessary_parenthesis

In preparation for null safety migration, I'm first fixing numerous
analysis complaints in the hope that it will make the migration go a
little bit more smoothly.

Remove unnecessary parentheses.

PiperOrigin-RevId: 360550907

* Clean up violations of Dart lint annotate_overrides

Add missing `@override` annotations.  This caught a bug where
`hashCode` was not overridden as intended because it was accidentally
mistyped as `hashcode`.

PiperOrigin-RevId: 360551084

* Clean up violations of Dart lint unnecessary_getters_setters

Replace trivial getters and setters with fields.

PiperOrigin-RevId: 360551490

* Clean up violations of Dart lint prefer_collection_literals

Use collection literals where possible.  Because a lot of this code
explicitly uses `LinkedHashMap` to indicate that order is important,
add appropriate `// ignore` comments until
https://github.com/dart-lang/linter/issues/1649 is addressed.

PiperOrigin-RevId: 360552809

* Clean up less trivial violations of miscellaneous Dart lints

* prefer_null_aware_operators
* hash_and_equals
* only_throw_errors
* avoid_bool_literals_in_conditional_expressions

Also replace usage of the deprecated zero-argument `List`
constructor.

PiperOrigin-RevId: 360552940

* Clean up trivial violations of miscellaneous Dart lints

* unnecessary_this
* prefer_final_fields
* avoid_single_cascade_in_expression_statements
* avoid_renaming_method_parameters

Also:
* Remove unused variables.
* Fix some cases where fields were implicitly `dynamic` because their
  type was omitted.
PiperOrigin-RevId: 360553040

* bump intl version to 0.18.0

intl: ">=0.15.2 < 0.18.0"

Closes #598

PiperOrigin-RevId: 361636495

* Internal changes

PiperOrigin-RevId: 361680107

Co-authored-by: nolankelly <[email protected]>
Co-authored-by: Googler <[email protected]>
Co-authored-by: mehmetf <[email protected]>
Co-authored-by: srawlins <[email protected]>
Co-authored-by: rearnshaw <[email protected]>
Co-authored-by: jiamingc <[email protected]>
Co-authored-by: jamesdlin <[email protected]>
Co-authored-by: Artyom Sasin <[email protected]>
Co-authored-by: lorrainekan <[email protected]>
  • Loading branch information
10 people authored Mar 9, 2021
1 parent 8dd8fa5 commit 1a00e94
Show file tree
Hide file tree
Showing 119 changed files with 3,948 additions and 966 deletions.
32 changes: 0 additions & 32 deletions charts_common/intellij_linux.blazeproject

This file was deleted.

32 changes: 27 additions & 5 deletions charts_common/lib/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export 'src/chart/bar/bar_label_decorator.dart'
show BarLabelAnchor, BarLabelDecorator, BarLabelPlacement, BarLabelPosition;
export 'src/chart/bar/bar_lane_renderer_config.dart' show BarLaneRendererConfig;
export 'src/chart/bar/bar_renderer.dart'
show BarRenderer, ImmutableBarRendererElement;
show BarRenderer, BarRendererElement, ImmutableBarRendererElement;
export 'src/chart/bar/bar_renderer_config.dart'
show
BarRendererConfig,
Expand All @@ -38,15 +38,22 @@ export 'src/chart/cartesian/axis/axis.dart'
measureAxisIdKey,
measureAxisKey,
Axis,
AxisOrientation,
NumericAxis,
OrdinalAxis,
OrdinalViewport;
export 'src/chart/cartesian/axis/draw_strategy/base_tick_draw_strategy.dart'
show BaseRenderSpec, BaseTickDrawStrategy;
export 'src/chart/cartesian/axis/draw_strategy/gridline_draw_strategy.dart'
show GridlineRendererSpec;
export 'src/chart/cartesian/axis/draw_strategy/none_draw_strategy.dart'
show NoneRenderSpec;
export 'src/chart/cartesian/axis/draw_strategy/range_tick_draw_strategy.dart'
show RangeTickRendererSpec;
export 'src/chart/cartesian/axis/draw_strategy/small_tick_draw_strategy.dart'
show SmallTickRendererSpec;
export 'src/chart/cartesian/axis/draw_strategy/tick_draw_strategy.dart'
show TickDrawStrategy;
export 'src/chart/cartesian/axis/numeric_extents.dart' show NumericExtents;
export 'src/chart/cartesian/axis/spec/axis_spec.dart'
show
Expand Down Expand Up @@ -93,17 +100,26 @@ export 'src/chart/cartesian/axis/spec/ordinal_axis_spec.dart'
OrdinalTickFormatterSpec,
OrdinalTickProviderSpec,
OrdinalScaleSpec,
RangeOrdinalTickProviderSpec,
SimpleOrdinalScaleSpec,
StaticOrdinalTickProviderSpec;
export 'src/chart/cartesian/axis/spec/percent_axis_spec.dart'
show PercentAxisSpec;
export 'src/chart/cartesian/axis/spec/range_tick_spec.dart' show RangeTickSpec;
export 'src/chart/cartesian/axis/spec/tick_spec.dart' show TickSpec;
export 'src/chart/cartesian/axis/tick.dart' show Tick;
export 'src/chart/cartesian/axis/tick_formatter.dart'
show SimpleTickFormatterBase, TickFormatter;
export 'src/chart/cartesian/axis/time/auto_adjusting_date_time_tick_provider.dart'
show AutoAdjustingDateTimeTickProvider;
export 'src/chart/cartesian/axis/time/base_time_stepper.dart'
show BaseTimeStepper;
export 'src/chart/cartesian/axis/time/date_time_extents.dart'
show DateTimeExtents;
export 'src/chart/cartesian/axis/time/date_time_tick_formatter.dart'
show DateTimeTickFormatter;
export 'src/chart/cartesian/axis/time/time_range_tick_provider_impl.dart'
show TimeRangeTickProviderImpl;
export 'src/chart/cartesian/cartesian_chart.dart'
show CartesianChart, NumericCartesianChart, OrdinalCartesianChart;
export 'src/chart/cartesian/cartesian_renderer.dart' show BaseCartesianRenderer;
Expand Down Expand Up @@ -152,7 +168,7 @@ export 'src/chart/common/behavior/range_annotation.dart'
export 'src/chart/common/behavior/selection/lock_selection.dart'
show LockSelection;
export 'src/chart/common/behavior/selection/select_nearest.dart'
show SelectNearest;
show SelectNearest, SelectionMode;
export 'src/chart/common/behavior/selection/selection_trigger.dart'
show SelectionTrigger;
export 'src/chart/common/behavior/slider/slider.dart'
Expand All @@ -173,7 +189,8 @@ export 'src/chart/common/behavior/zoom/panning_tick_provider.dart'
show PanningTickProviderMode;
export 'src/chart/common/canvas_shapes.dart'
show CanvasBarStack, CanvasPie, CanvasPieSlice, CanvasRect;
export 'src/chart/common/chart_canvas.dart' show ChartCanvas, FillPatternType;
export 'src/chart/common/chart_canvas.dart'
show ChartCanvas, FillPatternType, BlendMode;
export 'src/chart/common/chart_context.dart' show ChartContext;
export 'src/chart/common/datum_details.dart'
show DatumDetails, DomainFormatter, MeasureFormatter;
Expand Down Expand Up @@ -254,11 +271,16 @@ export 'src/common/symbol_renderer.dart'
LineSymbolRenderer,
PointSymbolRenderer,
RectSymbolRenderer,
RectangleRangeSymbolRenderer,
RoundedRectSymbolRenderer,
SymbolRenderer;
SymbolRenderer,
TriangleSymbolRenderer;
export 'src/common/text_element.dart'
show TextElement, TextDirection, MaxWidthStrategy;
export 'src/common/text_measurement.dart' show TextMeasurement;
export 'src/common/text_style.dart' show TextStyle;
export 'src/data/series.dart' show Series, TypedAccessorFn;
export 'src/data/series.dart' show AttributeKey, Series, TypedAccessorFn;
export 'src/data/tree.dart' show Tree, TreeNode;
//
// DO NOT ADD ANYTHING BELOW THIS. IT WILL BREAK OPENSOURCE.
//
1 change: 0 additions & 1 deletion charts_common/lib/src/chart/bar/bar_label_decorator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ class BarLabelDecorator<D> extends BarRendererDecorator<D> {
// Get space available inside and outside the bar.
final totalPadding = labelPadding * 2;
final insideBarHeight = bounds.height - totalPadding;
final outsideBarHeight = drawBounds.height - bounds.height - totalPadding;

var calculatedLabelPosition = labelPosition;
if (calculatedLabelPosition == BarLabelPosition.auto) {
Expand Down
23 changes: 13 additions & 10 deletions charts_common/lib/src/chart/bar/bar_lane_renderer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ import 'dart:collection' show LinkedHashMap;
import '../../data/series.dart' show AttributeKey;
import '../cartesian/axis/axis.dart'
show ImmutableAxis, domainAxisKey, measureAxisKey;
import '../cartesian/cartesian_chart.dart' show CartesianChart;
import '../common/chart_canvas.dart' show ChartCanvas;
import '../common/processed_series.dart' show ImmutableSeries, MutableSeries;
import 'bar_lane_renderer_config.dart' show BarLaneRendererConfig;
import 'bar_renderer.dart' show AnimatedBar, BarRenderer, BarRendererElement;
import 'bar_renderer_decorator.dart' show BarRendererDecorator;
import 'base_bar_renderer.dart'
show
allBarGroupWeightsKey,
barGroupCountKey,
barGroupIndexKey,
barGroupWeightKey,
Expand All @@ -50,8 +49,6 @@ const domainValuesKey = AttributeKey<Set>('BarLaneRenderer.domainValues');
/// swim lanes may optionally be merged together into one wide lane that covers
/// the full domain range band width.
class BarLaneRenderer<D> extends BarRenderer<D> {
final BarRendererDecorator barRendererDecorator;

/// Store a map of domain+barGroupIndex+category index to bar lanes in a
/// stack.
///
Expand All @@ -63,10 +60,12 @@ class BarLaneRenderer<D> extends BarRenderer<D> {
/// as the data was given to the chart. For the case where both grouping and
/// stacking are disabled, this means that bars for data later in the series
/// will be drawn "on top of" bars earlier in the series.
// ignore: prefer_collection_literals, https://github.com/dart-lang/linter/issues/1649
final _barLaneStackMap = LinkedHashMap<String, List<AnimatedBar<D>>>();

/// Store a map of flags to track whether all measure values for a given
/// domain value are null, for every series on the chart.
// ignore: prefer_collection_literals, https://github.com/dart-lang/linter/issues/1649
final _allMeasuresForDomainNullMap = LinkedHashMap<D, bool>();

factory BarLaneRenderer({BarLaneRendererConfig config, String rendererId}) {
Expand All @@ -76,8 +75,7 @@ class BarLaneRenderer<D> extends BarRenderer<D> {
}

BarLaneRenderer._internal({BarLaneRendererConfig config, String rendererId})
: barRendererDecorator = config.barRendererDecorator,
super.internal(config: config, rendererId: rendererId);
: super.internal(config: config, rendererId: rendererId);

@override
void preprocessSeries(List<MutableSeries<D>> seriesList) {
Expand All @@ -89,7 +87,7 @@ class BarLaneRenderer<D> extends BarRenderer<D> {
final domainFn = series.domainFn;
final measureFn = series.rawMeasureFn;

final domainValues = Set<D>();
final domainValues = <D>{};

for (var barIndex = 0; barIndex < series.data.length; barIndex++) {
final domain = domainFn(barIndex);
Expand Down Expand Up @@ -118,7 +116,7 @@ class BarLaneRenderer<D> extends BarRenderer<D> {

// Add gray bars to render under every bar stack.
seriesList.forEach((ImmutableSeries<D> series) {
Set<D> domainValues = series.getAttr(domainValuesKey) as Set<D>;
var domainValues = series.getAttr(domainValuesKey) as Set<D>;

final domainAxis = series.getAttr(domainAxisKey) as ImmutableAxis<D>;
final measureAxis = series.getAttr(measureAxisKey) as ImmutableAxis<num>;
Expand All @@ -127,6 +125,7 @@ class BarLaneRenderer<D> extends BarRenderer<D> {
final barGroupIndex = series.getAttr(barGroupIndexKey);
final previousBarGroupWeight = series.getAttr(previousBarGroupWeightKey);
final barGroupWeight = series.getAttr(barGroupWeightKey);
final allBarGroupWeights = series.getAttr(allBarGroupWeightsKey);
final measureAxisPosition = measureAxis.getLocation(0.0);
final maxMeasureValue = _getMaxMeasureValue(measureAxis);

Expand Down Expand Up @@ -181,6 +180,7 @@ class BarLaneRenderer<D> extends BarRenderer<D> {
barGroupIndex: barGroupIndex,
previousBarGroupWeight: previousBarGroupWeight,
barGroupWeight: barGroupWeight,
allBarGroupWeights: allBarGroupWeights,
color: (config as BarLaneRendererConfig).backgroundBarColor,
details: BarRendererElement<D>(),
domainValue: domainValue,
Expand Down Expand Up @@ -210,6 +210,7 @@ class BarLaneRenderer<D> extends BarRenderer<D> {
barGroupIndex: barGroupIndex,
previousBarGroupWeight: previousBarGroupWeight,
barGroupWeight: barGroupWeight,
allBarGroupWeights: allBarGroupWeights,
color: (config as BarLaneRendererConfig).backgroundBarColor,
details: BarRendererElement<D>(),
domainValue: domainValue,
Expand Down Expand Up @@ -341,9 +342,11 @@ class BarLaneRenderer<D> extends BarRenderer<D> {

/// Gets the maximum measure value that will fit in the draw area.
num _getMaxMeasureValue(ImmutableAxis<num> measureAxis) {
final pos = (chart as CartesianChart).vertical
final pos = chart.vertical
? chart.drawAreaBounds.top
: isRtl ? chart.drawAreaBounds.left : chart.drawAreaBounds.right;
: isRtl
? chart.drawAreaBounds.left
: chart.drawAreaBounds.right;

return measureAxis.getDomain(pos.toDouble());
}
Expand Down
6 changes: 3 additions & 3 deletions charts_common/lib/src/chart/bar/bar_lane_renderer_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class BarLaneRendererConfig extends BarRendererConfig<String> {
int layoutPaintOrder = LayoutViewPaintOrder.bar,
this.mergeEmptyLanes = false,
int minBarLengthPx = 0,
double stackHorizontalSeparator,
int stackedBarPaddingPx = 1,
double strokeWidthPx = 0.0,
BarRendererDecorator barRendererDecorator,
SymbolRenderer symbolRenderer,
Expand All @@ -67,7 +67,7 @@ class BarLaneRendererConfig extends BarRendererConfig<String> {
layoutPaintOrder: layoutPaintOrder,
minBarLengthPx: minBarLengthPx,
fillPattern: fillPattern,
stackHorizontalSeparator: stackHorizontalSeparator,
stackedBarPaddingPx: stackedBarPaddingPx,
strokeWidthPx: strokeWidthPx,
symbolRenderer: symbolRenderer,
weightPattern: weightPattern,
Expand All @@ -89,7 +89,7 @@ class BarLaneRendererConfig extends BarRendererConfig<String> {
return other.backgroundBarColor == backgroundBarColor &&
other.emptyLaneLabel == emptyLaneLabel &&
other.mergeEmptyLanes == mergeEmptyLanes &&
super == (other);
super == other;
}

@override
Expand Down
Loading

0 comments on commit 1a00e94

Please sign in to comment.