Skip to content

Rustem/time_labels #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Aug 11, 2020
Merged

Rustem/time_labels #11

merged 26 commits into from
Aug 11, 2020

Conversation

ruskakimov
Copy link

No description provided.

@ruskakimov ruskakimov changed the base branch from master to dev July 24, 2020 07:41
@ramin-deriv
Copy link
Contributor

ramin-deriv commented Jul 29, 2020

@ruskakimov Don't know you are aware or not. But I think your PR has failed because of a recent change in flutter-deriv-api.

  • Run flutter pub upgrade on the project to update flutter-deriv-api git dependency

  • Then in main.dart of the example change ModuleContainer().initialize(Injector.getInjector()); to APIInitializer().initialize(); (Don't forget to remove the unused import)

DateTime _closestFutureDayStart(int leftBoundEpoch) {
final left = DateTime.fromMillisecondsSinceEpoch(leftBoundEpoch);
var t = DateTime(left.year, left.month, left.day); // time 00:00:00
return t.isBefore(left) ? t.add(_day) : t;
Copy link
Contributor

@ramin-deriv ramin-deriv Jul 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be using DateTimes in UTC otherwise in some cases adding/subtracting durations might give us wrong results. Or Add TODO for later to make sure we get them right. 🤔
https://api.dart.dev/stable/2.6.0/dart-core/DateTime/DateTime.utc.html

Also according to this: https://stackoverflow.com/a/51250602 , creating another instance of DateTime is safer than adding/subtracting

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ramin-fs @ruskakimov is it possible to set the timezone by the third-party app while instantiating the chart? the default should be UTC.

Copy link
Author

@ruskakimov ruskakimov Jul 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@morteza-binary in dart:core there are only two options: UTC or local time zone.
There are read-only properties timeZoneOffset and timeZoneName.
But I haven't found anything in the docs about setting the time zone that is not local.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raminvakili-fs I will try to find a test case that will fail with the current implementation. 👍

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the spirit of TDD 😉

Copy link
Author

@ruskakimov ruskakimov Jul 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raminvakili-fs I have identified potential problematic parts as

  • leap seconds
  • leap days
  • daylight saving time (DST)

What I found:

This DateTime.parse('1933-01-01 00:00:00').add(Duration(hours: 1)) evaluates to 1933-01-01 01:20:00.000. Because KL clock was shifted by 20 min in 1933.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no daylight savings in UTC. So, if we switch to UTC, looks like we won't have any problems with add(Duration...).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@morteza-binary which time zone is web using?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ruskakimov Nice detailed info!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UTC

@morteza-binary which time zone is web using?

@morteza-binary
Copy link

@ruskakimov please solve the conflicts.

@morteza-binary morteza-binary merged commit 5f0f6c4 into deriv-com:dev Aug 11, 2020
ramin-deriv added a commit that referenced this pull request Oct 17, 2023
* Merged master to dev (#9)

* Morteza/add_ci_config (#6)

* Added coverage to ignored list

* Added CI config to build the example app

* Morteza/add ci config (#8)

* Added coverage to ignored list

* Added CI config to build the example app

* Fixed the issue of working directory

* Set to always deploy the test coverage

* Added coveralls badge

* Clean the config file (#10)

* Ramin/chart_pagination (#4)

* Adding loading before the first tick

* Limit scroll to the left

* Triggering onLoad callback

* Using Flutter deriv-api

* minor refactor

* Prepending historical data to candles

* Check to not make a history call more that once

* drawing loading bars

* Adding animation to loading

* Loading animation in half of height square

* Loading animation for the other half

* Getting history by setting count instead of start_time
 - Granularity may be wrong in the response got by setting start_time

* Loading in 75% of the screen

* Handling rightEpoch's lowerLimit not being passed by zoom gesture

* Fixed loading animation

* Fixed loading bar width & extracted paint func into a file

* Minor code cleanup

* Minor refactor

* Renamed onLoadMore to onLoadHistory

* Moved callback logic onScaleAndPanUpdate

* Fixing loading animation

* Fixed empty space in loading aniamtion on landscape

* Limit rightBoundEpoch lower limit in pan and panAndScale

* showing full-screen loading if candles are empty

* right epoch lower limit be as 2 screen width

* Minor refactor

* Minor refactor in paintLoading func

* Removed redundant check in if condition

* Fixed Jut-out in loading animation bars

* Minor refactor

* Minor improvment

* Minor fix

* Moved OnLoadHistory to a separate file

Co-authored-by: Morteza Tavanarad <[email protected]>

* Ramin/animate_to_current_tick (#2)

* Animating to current tick when arrow button is clicked

* Animation duration relative to distance so it animate by a similar pace every time

* Using a Tween Animation instead

* idea/codeStyle in gitignore

* Using only AnimationController again and have animation duration relative

* Removed relative duration.

* Hiding scrollToNow button while already animating

* Adding the animation time to its upperbound

* A separate getter to check arrow button be visible

* Minor refactor

* Rustem/crosshair (#3)

* Find closest candle util function

* Return candle with closest epoch

* Prepare to split painter

* Extract current tick painter

* Extract grid painter

* Reduce chart painter dependencies

* Cleanup imports

* Rename custom gesture detector

* Add longpress callbacks

* TDD canvasXToEpoch

* Vertical line that snaps to candle on long press

* Move chart HUD outside chart area

* Extract paintText

* Tick crosshair label

* Rename function

* Candle crosshair

* Style and refactor candle details

* Switching between candle/line crosshair

* Move to widgets folder

* Handle longpress ourselves, to prevent zoom and pan lag when scale and long press gestures "fight on arena"

* Fix bug when crosshair is left behind, when all fingers lift off

* Refactor method called after number of fingers changed

* Vibrate on switching to crosshair mode

* IQ options style candle details

* Pass style

* Line style crosshair details

* Fix line style details background gradient

* Crosshair line gradient

* Refactor longpress handlers

* Animate scroll to now button

* Zoom out in crosshair mode

* Update crosshair when it is on last candle and candle values change

* Fix typo

* Tweak crosshair details style

* Morteza/add_ci_config (#6)

* Added coverage to ignored list

* Added CI config to build the example app

* Morteza/add ci config (#8)

* Added coverage to ignored list

* Added CI config to build the example app

* Fixed the issue of working directory

* Set to always deploy the test coverage

* Added coveralls badge

* Requested changes

* Fix: Current tick dot is missing on first tick after loading

* Remove invisible button (remove animation for now)

* Repaint loading animation only when it is visible

* Reduce crosshair details shadow

* Add const to Durations

Co-authored-by: Morteza Tavanarad <[email protected]>

* Morteza/fix_circleci_build (#13)

* Changed the location of the apk file.

* Upgraded to the latest version of flutter-deriv-api

* Rustem/time_labels (#11)

* Fix grid epochs for 24h interval

* Include left bound epoch for day intervals

* Refactor to represent interval as Duration

* Fix broken tests

* Update comment

* Use daysPerWeek static const instead of a literal

* Enforce output epochs to be sorted

* Add green tests

* Add green tests for 2h interval

* Add green tests for 4h interval

* Return start of Mondays for week interval

* Minor refactor

* Refactor

* Return as DateTime objects instead of epochs

* Add month interval

* Calc days until monday instead of while loop

* Add year, month and date time labels

* Update test name

* Update flutter-deriv-api

* Requested changes

* Refactor to use DateTime constructor cleverness

* Switch to UTC

* Missed UTC conversion

* Remove function names from test names, simplify test names

* ramin/add_ananlysis_options (#16)

* Add ananlysis_options.yaml

* Add flutter analyze to CI (Ignoring lib and example for now to pass CI)

* Apply requested changes

* Ramin/market_selector (#5)

* Adding MarketSelector

* Categorizing the list of markets and submarket

* Created the markets categorized list view

* Filtering list by typing in search bar

* Not showing submarket name when its list is empty

* not showing market name when its submarkets are filtered out

* Minor refactor

* Added OnAssetClicked callback

* Minor UI change

* used showBottomSheet to show market selector

* Adding search bar

* Switch to search mode and back

* Click callback for favorite

* Added symbols icons

* A little highlight on serach text sustring

* Placeholder for icons if its png not exist

* Some UI refactoring

* Fetch active symbols in example app

* Added symbol model

* Market selector button according to the design

* Some code refactoring

* Some code refactroing
 - Fixed padding in some png icons
 - More intervals in quote grid

* Minor code cleanup

* Fixed wrong quote label width in some symbols

* Fix review comments

* A typo fix

* Fix review comment

* Removed Project.xml

* Toggling asset's isFavorite in MarketSelector for now

* Animate to the selected symbol in MarketSelector

* Added AnimatedHighlight widget to highlight selected symbol in MarketSelector

* Used DraggableScrollableSheet to have drag to dismiss functionallity

* Fixed using selected symbol for API call

* Code cleanup

* Use the recent change flutter-deriv-api for initializing API

* Minor refactor

* Minor refactor

* Custom OverScroll Drag to dismiss

* Extracted drag-to-dismiss functionality into a separate widget

* Some code cleanup

* Completed search bar

* Cleanup SearchBar widget

* Added favorites list on top

* Add remove to favorites list with animation

* Intro animation for market selector (Default bottom sheet animation is a bit fast)

* Get the list of favorites from the outside too.

* Can pan to top again when over-scrolling to bottom

* Minor refactor

* Added widget test for MarketSelector

* Minor fix to avoid unwanted fling to bottom at start

* Minor change in onNotfication. (Not blocking scroll notification from bubbling up in widget tree)

* Test for assets filter search

* Code cleanup

* close search bar text controller on dispose

* Dispose FocusNode as well

* Fix widget test descriptions

* Fix not over-scrolling in iOS

* Fix requested changes

* requested changes

* Include Market and SubMarket titles in search

* Refactord checking contains text for in search

* Added NoResultPage for search

* Minor UI change

* Minor code cleanup

* Minor change.(requested comment)

* Fix NoResultPage icon size

* Added some documentations

* removed unused import

* Minor fix in some comments

* Fix review comments

* Fixed padding from top for NoResultPage

* Test case to check selected asset being highlighted

* Changed text favorites to favourites

* Changed to favourite spelling for varaibles, methods etc

Co-authored-by: Morteza Tavanarad <[email protected]>

* Rustem/scroll_inertia (#15)

* New way to call api initializer

* Preserve scroll momentum

* Use a single Stack

* Prepare for GestureManager extraction

* Register gesture callbacks using gesture manager

* Reduce boilerplate with a template method

* Remove gesture callbacks on dispose

* Refactor crosshair feature (few things left)

* Clean up imports

* Move update crosshair on last candle to CrosshairArea

* Move crosshair_painter

* Add todos

* Call passed callback when crosshair appears

* Mark all chart params for removal in crosshair

* Refactor crosshair zoom in/out

* Improve docs

* Clean up, stop momentum on touch

* Remove cascade invocations

* Remove unnecessary check

* Convert to const

* Update candles after applying momentum to remove gaps

* Reduce scrolling back limit

* Stop momentum when hitting a bound

* Add finals

* Stop existing momentum on scroll to now

* Update crosshairMode bool, add TODOs

* Chain calls to gesture manager

* Stick to one callback naming convention

* Call onLoadHistory after flinging and hitting the left limit

* Refactor scroll momentum callback

* Better var name

* Add doc comment to  CrosshairArea

* Add explanatory comments to gesture manager/detector

* Use AnimationController for simulation

* Update ios .pbxproj, ignore last build generated file

* Apply limits on momentum

* Move visible candles & quote targets update in build

This is to avoid gaps on the edges, when rightBoundEpoch is updated after visible candles. _onNewFrame, which previously updated visible candles, is called before all animation listeners, because listeners are registered after it and "transient callbacks" are called in registration order (see https://api.flutter.dev/flutter/widgets/WidgetsBinding/drawFrame.html for mode details).

* Stop momentum immediately on touch

* Load history as soon as missing data is visible

* Refactor history loading

* Use better var name

* Remove unnecessary call

Co-authored-by: Morteza Tavanarad <[email protected]>

* Ramin/add_theme (#17)

* Added theme interface and example theme classes

* Minor refactor

* Adding painting style classes

* Use grid and CurrentTick style

* Add ChartPainting style to pass to ChartPainter and CrossHairPainter

* Use CandleStyle in paintCandle

* Dashed line for current tick indicator based on the design

* Background color for chart with Ink widget

* Some doc comments

* Test for ChartDefaultTheme

* Code cleanup

* Default values for style classes

* TODO to add cross-hair style later

* Fixed some requested changes

* Add default light and dark themes

* Add painting styles to theme

* Fix themes class documentation

* Fix LightTheme base08 color

* Minor refactor

* Define ChartTheme in MarketSelector widget

* Use theme in MarketSelector widgets

* Getting MarketSelectorButton style by constructor

* Code format and fix imports

* Moved assigning default theme to Chart widget build

* Made paintDashedLine a general function

* Moved _setChartPaintingStyle to initState

* Added documenation for painting style classes

* Added some TODOs

* A TODO in crosshair_details.dart

* A TODO in crosshair_painter.dart

* Add dimens to the ChartTheme

* Rustem/X axis refactoring (#19)

* New way to call api initializer

* Preserve scroll momentum

* Use a single Stack

* Prepare for GestureManager extraction

* Register gesture callbacks using gesture manager

* Reduce boilerplate with a template method

* Remove gesture callbacks on dispose

* Refactor crosshair feature (few things left)

* Clean up imports

* Move update crosshair on last candle to CrosshairArea

* Move crosshair_painter

* Add todos

* Call passed callback when crosshair appears

* Mark all chart params for removal in crosshair

* Refactor crosshair zoom in/out

* Improve docs

* Clean up, stop momentum on touch

* Remove cascade invocations

* Remove unnecessary check

* Convert to const

* Update candles after applying momentum to remove gaps

* Reduce scrolling back limit

* Stop momentum when hitting a bound

* Add finals

* Stop existing momentum on scroll to now

* Update crosshairMode bool, add TODOs

* Chain calls to gesture manager

* Move maxCurrentTickOffset

* Fix todos

* Move interval constants

* Provide model, move one var to the model

* Stick to one callback naming convention

* Call onLoadHistory after flinging and hitting the left limit

* Refactor scroll momentum callback

* Better var name

* Ignore .last_build_id

* Update project.pbxproj

* Move scale state to xAxisModel

* Use existing method to compute granularity

* Add doc comment to  CrosshairArea

* Add explanatory comments to gesture manager/detector

* Use AnimationController for simulation

* Update ios .pbxproj, ignore last build generated file

* Apply limits on momentum

* Move visible candles & quote targets update in build

This is to avoid gaps on the edges, when rightBoundEpoch is updated after visible candles. _onNewFrame, which previously updated visible candles, is called before all animation listeners, because listeners are registered after it and "transient callbacks" are called in registration order (see https://api.flutter.dev/flutter/widgets/WidgetsBinding/drawFrame.html for mode details).

* Stop momentum immediately on touch

* Load history as soon as missing data is visible

* Refactor history loading

* Use better var name

* Remove unnecessary call

* Add scale start handler

* Pass details

* Move scale update handler to x axis model

* Notify listeners

* Add x axis widget to register/remove gesture callbacks

* Add XAxis getter

* Store granularity in xaxis model

* Move defaultScale computation to xAxisModel

* Encapsulate granularity

* Simplify getters

* Add docs

* Make interval var private

* Move convertion method to xaxis model

* Use convertPxToMs directly

* Use convertMsToPx directly

* Use convert method

* Remove unused argument

* Use a method directly

* Use xaxis granularity

* Move rightBoundEpoch to  xAxis model

* Move some pan update logic

* Move nowEpoch

* Update x axis with canvas width

* Extract leftBoundEpoch computation

* Move scaleWithNowFixed

* Move scaleWithFocalPointFixed

* Move autopan state

* Crosshair area asks x axis model to stop autopan when crosshair is visible

* Add explanatory comment

* Extract remaining bits of scale logic

* Use XAxis widget that manages axis lifecycle

* Extract autopanning

* Extract x axis init

* Fix typo

* Extract maxRightBoundEpoch

* Move pan reset to updateGranularity

* Name bool

* Rename x axis width property

* Extract vertical scale method for readability

* Rename method

* Add missing notifyListeners call

* Pass firstCandleEpoch to x axis

* Make nowEpoch private

* Fix lint

* Remove breaking notifyListener

* Fixed crash on empty candles

* Call onNewTick each time candles update

* Move condition to updateGranularity

* Don't show scroll to now button when chart is empty

* Pass granularity to XAxis widget

* Move x axis init

* Use constructor instead of init

* Move granularity update handler to x axis widget

* Add todo

* Use named arguments

* Pass first candle epoch to x axis model

* Update first candle epoch in model

* Chain calls

* Add minRightBoundEpoch getter

* Get min scroll bound from x axis model

* Remove unused method

* Extract second responsibility

* Rename methods

* Only wrap changes in setState

* Move pan clamping to x axis model

* Move pan callback registration to x axis widget

* Move hasHitLimit getter to model

* Move epoch <-> x position convertion to model

* Use methods from provided model

* Switch Align with Center

* Add getter and setter for rightBoundEpoch

* Move rightBoundEpoch clamping to setter

* Use existing getter

* Use constructor initializers

* Set up another animation controller in x axis widget

* Copy scroll to now method

* Give controller to x axis model

* Fix null ref error

* Move scroll to now

* Fix compilation errors

* Add todo

* Refactor quote label area recalculation

* Grammar

* Move scroll momentum to x axis model

* Remove pan animation controller from chart.dart

* Make momentum method private

* Add doc comments

* Fix blunder

* Remove optional arg

* Extract into method for readability

* Add todo

* Add todo

* Better name

* Disable panning without data

* Expose only 1 bool if x axis is being animated

* Dispose of ticker

* Move autopan ticker to x axis

* Call datetime from constructor

* Refactor constructor

* Make scrolling limits private

* Add doc comment

* Group all private vars

* Make msPerPx private

* Move time grid interval to xaxis model, hide msPerPx

* Add doc

* Sort params

* Expose scale value instead of adding more responsibilities

* Simplify ticker callback

* Remove unused import

* Separate x and y axis grid paint functions

* Move x grid to x axis widget

* Create x_axis folder

* Separate x and y grid painters into files

* Separate x  and y grid paint functions into files

* Move x axis related files

* Break up large file

* Remove dependency

* Remove unnecessary assignment

* Fix tests

* Fix lint

* Use same fix as Ramin

* Remove todo

* Add docs

* Fix lint

* Add docs

* Fix lint

* Make fiels private

* Improve doc

* Add todos

* Add  test file

* Update lib/src/chart.dart

Co-authored-by: Morteza Tavanarad <[email protected]>

* Update lib/src/x_axis/x_axis_model.dart

Co-authored-by: Morteza Tavanarad <[email protected]>

* Move comment

* Clarify comment

* Use arrow functions

* Remove -1 granularity

* X-axis model docs

* Update lib/src/x_axis/x_axis_model.dart

Co-authored-by: raminvakili-fs <[email protected]>

* Review change

* Add todos

* Delete broken test

* Provide theme

* Use provided theme

Co-authored-by: Morteza Tavanarad <[email protected]>
Co-authored-by: raminvakili-fs <[email protected]>

* Rustem/Chart api docs (#20)

* Add docs

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

Co-authored-by: Morteza Tavanarad <[email protected]>

* Update README.md

* Update README.md

Co-authored-by: Morteza Tavanarad <[email protected]>

* Rustem/Candle width bug (#21)

* Pass granularity to chart instead of calculating

* Change comment

* Improve doc

* Stick to one term

* Update README.md

* Ramin/ws_reconnect (#12)

* Using ConnectionBloc to ws reconnecting

* Initialize ConnectionService in project

* Resume tick history and stream from where we disconnected

* Some UI refactoring

* Minor refactor

* Removed initializing ConnectionService (Will be initialized in ConnectionBloc internally)

* Using future to know whether previouse request was completed to make a new one

* Minor change in request completer flow

* Complete request after resuming connection too

* Moved assigning candles list inside setState

* await on previous request to complete and then request for the new one

* Fixed passing loadingRightBoundX

* Code cleanup

* Removed unused import

* Use TickHistorSubscription object instead of TickBase to unsubscirbe

* Remove hardcode R_50 and use symbol name instead

* Pass the pipSize gotten from API to the Chart

* Use the main flutter-deriv-api (WS and ConnectionBloc changes PR got merged)

* Fix not switching after previous subcription had and error

* Load first open symbol as the starting default

* Minor refactor

* Fixed calling getGranularityLabel func

* Replace print with dev.log

* Remove a redundant if condition

* Auto-scroll limit an offset from leftBoundEpoch

* await on _tickStreamSubscription.cancel()

* Merge functions _initTickStream and _resumeTickStream

* candles instead of firsEpochCandle for XAxisModel

* leftBoundEpoch getter instead of calculating

* Extract autoPan stop condition into a getter

* Combine _autoPanLimitHasReached and _autoPanning

* Clear candles after changing interval or symbol to show the loading animation

* Return in _handleTickStream when the condition is not met

* Return if _reuestCompleter is NOT completed

* Removed redundant setState

* Reversed if condition and return in ConnectionBloc.listen

* Added a TODO

* Hightlight selected asset in favorites list too if it was

* Update the broken test

* Added the removed setState with comment on connection change

* rename _autoPanLimitHasReached to _currentTickFarEnoughFromLeftBound

* Changed Disconnected status label text

* Rustem/Reduce accidental y-scale triggers (#24)

* Extract function

* Only scale y when pan starts on price label area

Co-authored-by: Morteza Tavanarad <[email protected]>

* Convert crosshair time label to UTC (#25)

Co-authored-by: Morteza Tavanarad <[email protected]>

* Simplify onloadhistory (#23)

* Remove start epoch history request check from example

* Remove redundant parameters

* Update docs

* Doc new line

* Fix history request rate

* Increase requested extension

* Remove loading logic from chart

* Remove no longer used state var

* Pass callback to xaxis

* Remove public rightBoundEpoch setter

* Add scroll and scale callbacks to model

* Load more data in example

* Only ui state changes in setstate

* Redundant remove

* Update readme

* Update README.md

Co-authored-by: raminvakili-fs <[email protected]>

Co-authored-by: raminvakili-fs <[email protected]>

* Ramin/add chart series (#22)

* Added BaseSeries

* Added BaseRenderable

* Adding line series

* Minor refactor

* Refactored getMixMax method in BaseSeries

* Providing conversion functions for renderablea

* Replacing candles with BaseSeries

* Painting a line chart as POC

* Brought back cross-hair

* Calculate quoteLabelWidth incase mainSeries is not empty

* Code cleanup
 - Merge common codes for updating visibleEntries indices in BaseSeries

* visibleEntries getter for BaseSeries

* Minor fix
 - Fix special conditions in calculating lower/upper indices of visibleEntries

* Update docs of BaseSeries

* Generic type for BaseSeries

* Checkpoint: removing ChartStyle

* Styles for chart series

* CurrentTickStyle inside ChartPainting style

* Getting cross-hair info from the series itself

* Adding candle series

* Add CandleSeries
 - Paint candles in CandleRenderable
 - getMinMax method implememntation in CandleSeries
 - Switch between LineSeries and CandleSeries in example app

* Animate last candle paint in CandleRenderable

* Minor fix
 - Last visible candle was not painted if last candle wasn't in the frame

* Paint current tick dot

* Paint current tick indicator (label, dot, line)

* Code cleanup
- Fix imports
- Rename series update method

* Passing pipSize to get cross-hair info

* Fix animating last tick in LineSeries
 - Fix line area startX

* Code cleanup

* pipSize access in BaseRenderable

* Add secondarySeries
 - Added a sample MA to show multiple series usage

* Call didUpdate for secondarySeries as well

* Minor refactor in Indicators class

* Rename to base classes to Series & Renderable

* Remove left/right epochs from updateRenderable method

* Added MASeries

* Renderable of type Series

* Assigning visibleEntries of Series directly

* Removed visibleEntries param too from getMinMaxValues method

* Moved MASeries to indicators_series directory

* Sample Series & Renderable with multiple data series

* Add Chart Component

* doc update

* Use Compoenent in ChartPainter

* Minor refactor
 - _ChartImplementation only takes a list of Components which indludes on-chart indicators, markers, barriers,...

* Code cleanup

* Fix min/max value in SampleMultiSeries bing NaN sometimes

* Fix lint warnings in indicators.dart

* Calculating min/max by only one for loop on visibleEntries

* granularity in Series paint method

* Renamed Compoenent -> ChartData

* Updated doc

* Code cleanup

* updated README

* Minor refactor (renamed a method)

* Fix CandleSeries doc

* main visibleEntries as loadingRightBoundX

* Adding DataSeries

* Added DataSeries

* Removed duplicate code of calculating min/max in CandleSeries

* Code cleanup

* setState on clearing candles so Indicator's get clear too

* Made Chart series id optional
 - Using runtimeType if null

* Use MASeries inside SampleMultiSeries

* Default id for MASeries

* Update README

* Check min/maxQuote is valid before using it for AnimationControllers

* Added OHLCTypeSeries
 - To keep shared functionality between OHLC, CandelStick and Hollow

* OHLC type series folder structure

* Changed createRenderable method to return Renderable and set it in Series class

* Renamed Renderable -> SeriesPainter

* Removed Candle.tick constructor
 - Will be looking to chart data whether Candle or Tick as list of Tick.

* Ramin/svg icons (#29)

* Added symbols SVG files

* Using SVGs + Removed PNGs

* Fix <defs> tag order in some SVG files

* Showing a message when Markets list is empty

* Placeholder for SVG icons while they're being parsed

* Fixed imports in market_selector directory

* MarketSelectorButton padding to 8

* Helper function to get path to the asset SVG

* A wrapper widget to add SvgPicture for MarketSelector symbols

* Latest version of flutter_svg

* Update doc in symbol_svg_picture

Co-authored-by: Morteza Tavanarad <[email protected]>

* Ramin/fix_off_screen_loading (#30)

* Fixed off-screen loading

* Minor code cleanup

* Removed redundant leftPointY variable

* Fix lint warnings

* Add in Chart widget (#32)

* Ramin/closed markets (#28)

* Show closed tag next to closed symbols

* Get history without subscription for closed symbols

* Added Platinum/USD icon

* cancle StreamSubscription on _initTickStream start

* adjustStartTime in request because of closed markets

* Added ChartController
 - scrollToNow after loading an asst

* Default value for Asset isOpen

* Check if Historical data isEmpty

* Adding TradingTimesReminder

* Filling map of market status changes

* Time to UTC

* Not adding change times that are alreay passed

* Use RegExp to check if time in String is valid

* Reinitiating current symbol when its status changes

* Code cleanup

* Minor change

* trading times reminder test

* Minor change on trading_times test

* Docs for trading_times.dart

* Ignore allDayClosed/allDayOpen symbols

* Removed SymbolStatusChange, Using Map instead

* Refresh market selector on market status change

* Jump option for scrollToNow

* Fix getting open/close times since was fixed in flutter-deriv_api

* Fixed updating _activeSymbols list

* Adding isLive property

* Update closed tag based on the design

* 0.5 opacity when isLive is false

* Disable current tick blinking when isLive is false

* Moved setup market reminder to a method

* resetting previous reminder when setting up a new one

* Changed endpoint to blue.binaryws.com

* Disabled opacity only for Chart data

* Code cleanup on market change reminder

* Callback method for getting TradingTimes

* Null check for secondarySeries

* Set reminder to rest on the next day

* Add doc for MarketChangeReminder

* scrollToNow method take bool animate

* ServerTime and status change times in UTC

* Format some files to have extra line at the end

* Add 5sec to timer finish time to make sure market change happened

* Minor fix in doc comment

* Requested changes

* Requested change for checking isScrollToLastTickAvailbale

* Minor review comment change

* _isLive null check

* isLive instead of _isLive

* Using BottomSheetController to update it after market status change

* fromJSON and toJSON for Asset class

* Unit test for showing closed tag

* Minor code cleanup

* ChartController callback not be private, No need for getter/setter

* addPostFrameCallback for calling scrollToLastTick

* Minor refactor: Directly use Future rather than using Completer

* Connect to QA45

* Connect to QA15

* Remove time gaps (#27)

* Add function stubs

* Handle epoch gap of 0

* Calc px distance without gaps

* Test when gaps dont overlap

* Handle the case when gap covers whole range

* Rename class

* Add more tests with gaps

* Rename function, pass range instead of left and right

* Extract ms width

* Fix overlap calc

* Fix lint

* Assert time range is valid

* Fix name in tests

* Add pxBetween to x axis

* Use pxFromMs for scale

* Enhance doc

* Add todos

* Take gaps into account in xFromEpoch

* Remove old test

* Handle x coordinates outside canvas

* Add todo

* Handle px shift of 0

* Extract time range into a file

* Handle future shift without gaps

* Remove pxToMs dependency

* Add negative shift test

* Handle epoch at the start of the gap

* Handle epoch in the middle of a gap

* Overlap returns time range

* Handle gap after epoch

* Handle far gap after epoch

* Handle two near gaps

* Add test with 3 gaps

* Handle near gap before

* Add failing test

* Switch near/far terms to obstructing/non-obstructing

* New algorithm (pass last test)

* Use for loop instead of while

* Add failing test

* Pass test

* Use gap method

* Exit early if once not overlapping next gap

* Add epoch shift to xaxis model

* Use shiftEpoch to calc leftbound

* Use shiftEpoch to calc scroll bounds

* Use shift on pan update

* Use shift on scalewithnowfixed

* Use shift on another scale

* Remove msFromPx! :tada:

* Handle gaps when converting x to epoch

* Pass dummy timegaps for testing

* Add todo

* Clamp pan update

* Handle gaps on scroll to now

* Take gaps into account on scroll momentum

* Remove print

* Remove dead code

* Ignore vscode launch config

* Dartfmt

* Consistent method name

* Reorder

* Find gaps stub

* New failing test

* Add toString to timerange

* Find gaps implementation

* Always return same epoch when pxShift is 0

* Fix conversion algorithm

* Update gaps

* Detect history load

* Detect tick load and reload

* Clean up

* Only check new data for gaps when history is loaded

* Add doc

* Graphical test description for epoch shift

* Partial algorith

* Right shift algorithm

* Find nearest gap

* Handle left shift

* Add comments

* Remove test time gap

* Docs about call order

* Prep to remove timegaps

* Remove dead function

* Add docs

* More docs

* Remove msToPx

* Remove time labels inside gaps

* Outline new algorithm

* Expose timegaps

* Remove overlapping time labels

* Extract constant

* Remove unused getter

* Update lib/src/logic/find_gaps.dart

Co-authored-by: raminvakili-fs <[email protected]>

* Update lib/src/x_axis/x_axis_model.dart

Co-authored-by: raminvakili-fs <[email protected]>

* Update lib/src/x_axis/x_axis_model.dart

Co-authored-by: raminvakili-fs <[email protected]>

* Add docs to time range

* Make shiftEpoch private

* Fix bad state

* Use production server

Co-authored-by: raminvakili-fs <[email protected]>

* Ramin/barriers (#31)

* Adding barriers

* A test horizontal barrier

* Annotations extend from Series

* Added BarrierPainter

* Barrier and HorizontalBarrier

* Painting H barrier label and value

* Add BarrierStyle
 - DataSeriesStyle instead of ChartPaintingStyle and ChartPaintingStyle more general

* Adding vertical barrier

* Painting a vertical test line

* Dashed line painting general functions  in paint_line file

* isDashed option for barriers

* Fix padding in horizantal padding

* Added docs

* Label for vertical barrier

* minor cleanup

* Use barrier title for the default

* Barrier object in barrier_objects file

* Background color for horizontal barrier (They might overlap with Y-Axis label)

* Updated README

* Added paintTextFromRight

* Use paintTextFromRight in other places

* Painting labels inside barrier_painter itself

* Label for horizontal barriers

* Adding combined(V&H) barrier

* hasLine param for BarrierStyle

* No title on horizontal line in Combined barrier

* Paint dot for combined barrier

* Create Paint object in constructor

* Null check in CombinedBarrier

* Minor code cleanup

* Paint horizontal barrier upward arrows

* Downward arrows

* minor fix

* Corner radius for downward arrows

* Corner radius for upward arrows

* Fix lint warnings

* Keep VerticalBarrier title always on-screen when its line is visible

* LastTickIndicator as a barrier as well

* Code cleanup

* Correct order on Z for barriers

* Code refactoring

* Update last tick indicator label background

* Pass style to LastTickIndicator in DataSeries

* Code cleanup

* Start epoch for horizontal barrier

* Value for vertical barrier

* Circle on Vertical barrier value

* LastTickIndicator -> TickIndicator

* More properties for tick indicator

* Use style toString too for the default id so series be more distinguishable

* Minor change in example app barriers list

* Added Horizontal and vertical barriers style

* Option to make line of vertical from tick or from top

* Styling intersection dot

* LabelShape for Horizontal barrier

* Painting dot option for horizontal barrier as well

* Contributing Horizontal barrier in Y-axis range be conditional

* Tick indicator sub-class of Horizontal barrier

* Code cleanup

* Code cleanup

* Cleanup on horizontal_barrier_painter

* Updated toString method of Style classes

* H & V common fields in Barrier class

* Paint object in constructor

* Bring back H Barrier objects, need for its leftEpoch

* Minor changes in IntersectionDotStyle

* Removed valueBackgroundColor

* Fix comment

* Extract creating arrow path to a file

* Minor code cleanup in horizontal_barrier_painter

* Button for adding sample barriers

* Removed export CurrentTickStyle, its replaced by HorizontalBarrierStyle

* Remove intersection dot painting and styles

* Exclude horizontal barrier from chart data that define min/max quote
- Decide for barrier arrow type when we want to paint it and its out of view port

* Option to indicate inculde/exclude H barrier in defining chart's Y-Axis range

* Update example/main.dart

* Minor refactor

* Removed hasLine option property from BarrierStyle

* LTR & RTL DashedLine function

* V dashed line paint from bottom to top

* Checkbox for adding sample SL and TP

* Visibilty option for Horizontal barrier
 - Normal (invisble when is out of range)
 - AlwaysVisible (show arrow when its out-of-range)
 - ForceToStayOnRange

* Update a comment

* Default visiblity value for CombinedBarrier

* Default color of barrier title background

* Temopararily moved barrier arrow before title until design is ready

* Clear barriers on interval switch too

* Some code cleanup

* alwaysVisible -> keepBarrierLabelVisible

* Minor refactor in horizontal_barrier_painter

* Minor refactor in create_shape_path.dart

* Added ChartObject test

* Added isOnValueRange to ChartObject

* Code cleanup in ChartObject

* When chart object is bigger and covers entire visible range

* Test for isOnValueRange

* Paint label at the end for HorizontalBarrier

* flutter format on barrier related clases

* longLine param in CombinedBarrier

* Description change in BarrierObject test

* Fix backward scrollToNow exception

* Ramin/Fix_updating_blinking_animation_controller_on_didUpdate (#34)

* Fix updating blinking animation controller on didUpdate

* Passing isLive to ChartImplementation
 - Its safer, it might be possible ChartImplementation.didUpdate get called before XAxis.didUpdate

* Update blinking animation status inside a method

* Just checking if isLive changed. (Less code)

* Getting opacity from outside

* scrollToLastTick, a situation where target < _rightBoundEpoch

* Different CustomPaint for mainSeries and other ChartData

* Requested review change

* Update opacity param used in example

* Fix dispose exception in CrossHairArea, XAxis, Chart (#37)

* Rustem/Markers (#33)

* Chart marker model

* Marker series

* Ignore vscode config

* Show sample markers

* Extract marker draw

* Add marker style to theme

* Move test markers

* Change hardcoded default color values (temp fix)

* Draw up marker shape

* Draw down marker

* Refactor marker painting

* Draw arrow

* Rotate down arrow

* Remove unused import

* Add callback to model

* Center marker around purchase price

* Center arrow in marker

* Update tappable areas

* Reorder

* Refactor gesture detector

* Trigger tap up

* Fix long press

* Refactor some more

* Refactor some more

* Refactor pointer count change callbacks

* Marker buttons

* Named marker constructors

* Handle marker tap

* Increase tap area

* Extract marker radius as a prop

* Extend series

* Marker area

* Fix

* Implement min/max

* Draw markers

* Add function stub, test throws exception

* TDD findEpochIndex

* Update visible markers

* Refactor findClosestToEpoch

* Fix

* Active marker class

* Add active marker on marker tap

* Toggle marker opacity

* Store tap area in the marker for robustness

* Extract paint marker

* Draw active marker

* Move radius to style

* Only pass necessary info to active marker paitner

* Remove dead code

* Rename symbol

* Fix tap bug

* Extract active marker painter file

* Control text anchor point

* Paint active marker label

* Remove redundant prop

* Split paint text

* Draw marker body, shift icon

* Add text padding

* Handle active marker tap

* Animate opacity

* Set up animation controller

* Change longpress hold duration

* Fix lints

* Remove print

* Animate marker in

* Animate marker out

* Don't inflate marker tap  area

* Apply animation curve

* Change animation duration

* Transparent markers are not tappable

* Update doc

* Speed up animation

* Extract animated active marker widget

* Update marker icon

* Add readme docs

* Remove unused dependencies

* Fix build

* Fix build

* Add delete markers button

* Dont build marker area without markerseries

* Clear markers on interval/market change

* Dont calc marker min max

* Dont paint fully closed active marker

* Delete active marker

Co-authored-by: Morteza Tavanarad <[email protected]>

* Rustem/Entry&exit markers (#43)

* Remove unused import

* Exit/entry tick

* Add entry marker style

* Add exit marker style

* Add styles to marker style

* Entry marker painter

* Paint exit marker

* Fix build

* Rename method

* Enhance doc

* Rename method

* Add headers to readme

* Readme docs for entry and exit tick markers

* Fix exception on dispose in MarkerArea (#42)

Co-authored-by: Morteza Tavanarad <[email protected]>

* Ramin/refactor_candle_painting (#36)

* Paint CandlePainting in-place insice 1st loop rather than in an additional loop

* Create Paint objects once in CandlePainter constructor

* Minor code cleanup

* Don't let high-low line instantly update faseter than candle close animation

* Add a comment

* Minor code cleanup in LinePainter

* Fix wrong import

* Rephrase a comment

* Move paintCandle function to CandlePainter

Co-authored-by: Morteza Tavanarad <[email protected]>

* Rustem/Current tick label width jitters (#38)

* Chart marker model

* Marker series

* Ignore vscode config

* Show sample markers

* Extract marker draw

* Add marker style to theme

* Move test markers

* Change hardcoded default color values (temp fix)

* Draw up marker shape

* Draw down marker

* Refactor marker painting

* Draw arrow

* Rotate down arrow

* Remove unused import

* Add callback to model

* Center marker around purchase price

* Center arrow in marker

* Update tappable areas

* Reorder

* Refactor gesture detector

* Trigger tap up

* Fix long press

* Refactor some more

* Refactor some more

* Refactor pointer count change callbacks

* Marker buttons

* Named marker constructors

* Handle marker tap

* Increase tap area

* Extract marker radius as a prop

* Extend series

* Marker area

* Fix

* Implement min/max

* Draw markers

* Add function stub, test throws exception

* TDD findEpochIndex

* Update visible markers

* Refactor findClosestToEpoch

* Fix

* Active marker class

* Add active marker on marker tap

* Toggle marker opacity

* Store tap area in the marker for robustness

* Extract paint marker

* Draw active marker

* Move radius to style

* Only pass necessary info to active marker paitner

* Remove dead code

* Rename symbol

* Fix tap bug

* Extract active marker painter file

* Control text anchor point

* Paint active marker label

* Remove redundant prop

* Split paint text

* Draw marker body, shift icon

* Add text padding

* Handle active marker tap

* Animate opacity

* Set up animation controller

* Change longpress hold duration

* Fix lints

* Remove print

* Animate marker in

* Animate marker out

* Don't inflate marker tap  area

* Apply animation curve

* Change animation duration

* Transparent markers are not tappable

* Update doc

* Speed up animation

* Extract animated active marker widget

* Update marker icon

* Add readme docs

* Remove unused dependencies

* Fix build

* Fix build

* Right align current tick label

* Remove unused argument

* Tabular figures for label

* Import font feature

* Right align quote labels

* Add  todos

* Use const

* Quote labels  tabular figures

* Move padding to style

* Move tick label padding to style

* Remove unused const

* Remove unused var

* Simplify grid painting

* Dont pass width to YGridPainter

* Better name

* Remove width recalc

* Add delete markers button

* Dont build marker area without markerseries

* Remove unused const

* Clear markers on interval/market change

* Dont calc marker min max

* Dont paint fully closed active marker

* Delete active marker

* Use make painter

* Fix build errors

* Tabular figures

* Fix lint

* Remove duplicate paint

* Use make painter

* Use paintWithTextPainter

* Pass shape instead of style

* Extract condition

* Refactor label background paint

* Extract label area computation

* Remove valueStartX

* Title area

* Only areas

* Keep label visible

* Scope var

* Only paint title if provided

* Center arrows

* If else

* Scope title painter

* Start calc in one place

* Combine ifs

* Paint full length line

* Extract blinking dot

* Erase behind title

* Arrows are to the left of  label if there  is no title

* Declare var higher

* Extract arrow mid x

* Add comments

* Main line -> line

* Combine two doubles into Offset

* Add todo

* Remove redundant clear

* Title background with padding

* Dont paint line in current tick right padding

* Line up labels

* Caption2 tabular figures

* samin/Apply_new_design_of_the_selectet_market_button (#41)

* add backgroundColor prperty to MarketSelectorButton

* add idea/misc.xml to git ignore

* add expanded to example project and add borderRadius to MarketSelectorButton

* change BorderRadius object instead of double

* fix minor format

* fix the sizeedbox size

* check markets beeging null

* make some properties const

* Delete misc.xml

Co-authored-by: Morteza Tavanarad <[email protected]>

* Ramin/provide_theme_for_series_painters (#40)

* Added ChartConfig class

* Pass chartConfig to _ChartImplementation

* Passing ChartConfig to ChartDataList

* Pass chartConfig to XAxis

* Use provided ChartConfig in ChartImplementation

* ChartTheme separate from ChartConfig

* == operator for ChartConfig

* Pass provided theme to ChartPainter

* ChartConfig and Theme in MultiProvider

* Minor refactor

* Granularity instead of ChartConfig in XAxisModel

* Using granularity getter in XAxisModel as before

* Removed redundant import

* Rustem/Separate time labels (#45)

* Fix build

* Add padding

* Remove x-axis label area height  from Chart

* Short if

* Rename vars

* Fix vertical padding computation

* Adjust zoom out animation

* Add area height to style

* Use area height during paint

* Fix lint

* Add doc

* Change area  height

* Add docs

* Fix lints

* Fix lint

* Clip above x-axis label area

* Ramin/fix_sticking_in_loading_on_closed_markets (#44)

* Make sure rightBoundEpoch is on a valid range

* Move calling clamp method inside updateEntries

* Fix calling clamp method inside XAxisModel

* clamp rightBoundEpoch outside postFramCallback

* Use clampRightBoundEpoch in some other places

* Minor refactor
 - XAxisModel update methods be private to handle their calling order internally

* Added some doc

* Rustem/Keep label visible (#47)

* Keep tick indicator label visible

* Add hasArrow property

* Set hasArrow to false for tickindicator

* Paint arrows according to style

* Move arrows

* Add paint barrier arrow

* Delete this failure

* Resize arrows to match design

* Move arrows

* Encaps var

* Adjust title area according to design

* Center arrows

* Erase the line behind title

* Refactor marker on tap

* Add asserts to marker

* Remove old import

* Smallest save layer area

* TP and SL are solid lines

* Extract and name const

* Refactor title area calc

* Rustem/Tick glitch (#52)

* Rename var

* Fix lint

* Doc

* Gap is at least 1min

* scaale a little bit less(max 5x) (#50)

* Samin/add_localizations (#46)

* working on..

* start to working on localazaation

* finished the localization

* fix a problem

* fix some tests

* fix last bug on tests:D

* update readme filee to support localization

* remove builder and strings manually

* Delete misc.xml

* reformat files

* fix review comments

* remove buildrunner

* Ramin/use_theme_in_series (#48)

* Use theme's style in CandlePainter

* Use theme's style in LinePainter

* Added barriers style the default theme

* Implement recalculateMinMax in VerticalBarrier

* For VerticalBarrierPainter

* For HorizontalBarrier

* arrowSize property in HorizontalBarrierStyle

* For MarkerPainter

* Fix conflict resolution errors

* Code cleanup

* Use default styles even if theme's one was null

* Sort markers list internally

* Should have used

* Fixed overLine TextStyle fontSize

* Sorting markers list be optional

* samin/fix_delay_in_loading_asset_icons (#51)

* add png icons to the app

* add depricated annotation to svg

* fix review comments

* remove generated files

* remove generated files in example

* Delete intl_en.arb

* Delete intl_en.arb

* fix review comments

* add the description to SymbolPNGPicture

* fix linter issues

* fix linter issues

* fix review comments

* remove props

* samin/Simplify_painting_barrier_up/down_arrow_icons (#56)

* simplify the path

* simplify the upward path

* change the arrowPaint

* aapply suggestion change

* export symbol_icon (#62)

* Ramin/fix_skipping_new_tick_animation (#49)

* Fix new tick animation in DataSeries classes

* Fix skipping animation on Annotations

* A minor fix

* Fix candle lint warnings

* Return didUpdate result as bool from ChartData.didUpdate() method

* Minor fix,

* Minor refactor

* Added a comment

* ramin/fix_marker_style_being_null (#58)

* Default MarkerStyle in AnimatedActiveMarker

* Take Markers as a SplayTreeSet
 - Per the discussion with the team

* _entries in MarkerSeries be SplayTreeSet too

* Back to list<Marker> in MarkerSeries

* Minor rafactor

* fix the problem with ramin's solution (#60)

* samin/Auto_scroll_when_CrossHair_is_close_to_the_edges (#53)

* set random values :D

* fix the problem

* update crosshair tick

* cheking _lastLongPressPositionEpoch

* make closeDistance const

* make speed class filed

* fix review comments

* fix review comments

* remove epoch calculation from _getClosestTick

* calculate _lastLongPressPositionEpoch in _onLongPressStart

* remove xtra lines

* clean code

* clamp _lastLongPressPosition

* fix review comments

* samin/fix_current_tick_problem_in_small_devices (#57)

* paint tick before chnaging the y

* working ...

* add defaultdefault variable

* remove print :D

* change the name to _minPadding

* remove ( :D

* Samin/update_crosshair_design (#61)

* start to work

* working on...

* change the color of lables

* add overline style

* delete unused import

* revert some changes

* add  analysis_options.yaml

* fix review comments

* remove _theme field

* remove _theme field

* fix review comments

* add fontFeatures to overLine style

* padding linee from top :D

* samin/Time_labeles_bug (#59)

* increase the _minDistanceBetweenTimeGridLines

* add fallsInGap function

* remove timeLabels inside the Gpas

* fix review comments

* fix overlap issue

* try to add test

* add unit test for time labels

* fix overlap problem

* add more intervals

* extracts calculateNoOverlapGridTimestamps logic to other function

* add _minDistanceBetweenTimeGridLines to calculateNoOverlapGridTimestamps

* refactore code

* Rustem/Perf (#54)

* Dont exclude

* Doc

* Rename msWidth -> duration

* Extract gap duration between

* Duration without gaps

* Move to x axis folder

* Refactor

* Update tests

* Remove prints

* Binary search overlapping gap range

* Fix 1 test

* Fix some tests

* Pass test

* Add green test with more gaps

* Remove prints

* Move gaps to GapManager

* Fix exception

* Modify gap list with methods

* Add cumulative sums docs

* Calc cumul sums

* Fix doc

* Move remove gaps implementation

* Fix

* Fix tests

* Calc gap range sum from cumulative sums

* Use existing bin search function

* Helpers file

* Equatable styles

* Prevent chart repaint (draft)

* Update on scroll

* Doc

* Repaint on quote bound animation

* Repaint on animation change

* Dont repaint when animation is outside viewport

* Repaint on bottom quote change

* Remove unnecessary clip

* Remove cliprect

* Extract timestamps update

* Extract computation from painter

* Only repaint labels on change

* Remove unused prop

* Dont rebuild on each frame

* Rebuild on scroll momentum simulation

* Update data only when visible area changes

* Update packages

* Reuse visible entries

* Rebuild on quote bound animation

* Remove implicit dynamic rule (error in generated file)

* Remove

* Fix disappearing tick label

* Fix animation loading update

* Extract loading animation widget

* Don't rebuild animation if invisible

* Clip loading animation

* Fix exception on loading history

* Redundant paint size

* Extract method

* Extract quote and animation build methods

* Separate annotations

* Move secondary series to data painter

* Refactor

* Update visible data on each build (since underlying data can change)

* Update visible range everytime series changes, but update min/max only if necessary

* MultipleAnimatedBuilder

* Animated tick  indicator

* Animate data  and crosshair

* Repaint when visible entries have changed

* Fix multiple animated builder

* Grid lines listen to  animations

* Update blink when crosshair is visible

* Fix gap manager blunder

* Remove unused test file

* Revert count

* Fix needs min/max update condition

* Fix loading on market switch

* Revert analysis options changes

* Clear previous visible entries on market switch

* Use arrow functions

* Fix more lints

* Fix timestamps

* Fix time label test

* samin/y_axis_visiblility (#63)

* add yLabelStyle

* add YGridLinePainter and  YGridLabelPainter painter

* move labels behind the current value

* add _labelWidth

* move LoadingPainter

* some changes

* add gridLineQuotes array

* add space

* fix confilicts

* add _buildQuoteGridLabel function

* Ramin/overlay_indicators (#55)

* Adding indicator logic base classes

* Adding Ichimoku

* Initial test for Ichimoku

* Adding SMAIndicator

* Test for SMAIndicator

* Code refactor

* Put classes into separate files

* result be List<Tick> cause we need the epoch too

* Check results array instead of getValue method in test

* Adding Parabolic SAR

* Having RecursiveCachedIndicator from TA4J

* Added EMA indicator

* type for Indicator

* Added ZELMA Indicator

* Code cleanup

* Minor refactor

* Added WMA indicator

* Added Hull moving average

* Minor refactor

* Adding Bollingers

* Rounding indicator result in tests

* BollingerBandSeries in its own file

* Upper band for BollingerBandSeries

* Code cleanup

* Some refactoring

* Calculate all indicator value in intialization, no caching

* results in CachedIndicator be final

* Code cleanup

* Refactoring comments

* Update BollingerBandSeries paint method

* Code cleanup

* Reorganize indicators directory structure

* Refactoring

* Helper indicator extend directly from AbstractIndicator
 - Doesn't make sense for them to hold a list of indicator result.

* Different test file for MA indicators

* Test for roundDouble function

* A minor refactor in helper_functions_test

* Minor refactor

* Use getEpochOfIndex method in indicators

* MovingAverageType enum in MASeries

* MA type in the default MASeries id

* LineStyle hasArea default false

* Fix ParabolicSar indicator

* Adding ChartPackage widget

* Adding IndicatorsDialog

* Adding indicators from IndicatorsDialog

* Removed resundant indicators key map

* Getting IndicatorItemCheckbox to work

* Provide indicators as a repo with Provider

* Removed redundant type from IndicatorItem

* Adding IndicatorConfig

* Minor fix

* Code cleanup, organize indicators UI files

* Period option for MAIndicator

* Adding BollingerBands Indicator to IndicatorsDialog

* Standard Deviation option for BollingerBands indicator

* Minor code cleanup

* Refactoring

* Fix some lint warnings

* Code cleanup in tests

* OHLC interface, Tick implement it

* MA and Bollinger series cand get indicator

* Some comment fix

* BollingerBandsIndicatorItemState extend from MAIndicatorItemState

* Added filed type option to MAIndicator
 - Added FiledIndicatorBuilder

* Fix a minor bug

* Minor refactor in MAIndicatorItem

* Use widget MAIndicator widget build methods in BollingerBands one

* Use field in creating BollingerBandsSeries too

* Added Hl/2 Indicator
 - Hlc/3, Hlcc/4, Ohlc/4 are pretty much the same.

* Renamed all barCount to period

* Renamed barCount to period in test

* Minor refactor

* Minor code cleanup

* use _series min/max instead of calculating it again

* Line/CandlePainter paint data of super-class  DataSeries

* AnimatedPopup optimisation

* Renamed ChartPackage to DerivChart

* Fix review comments

* Added some docs

* Minor refactor

* Requested changes

* Minor name fix

* Cleanup indicators tests

* Reduced dialog's fontsizes to 10 to prevent overflow

* Use ChartLocalization in indicators dialog

* Revert deleting analysis_options.yaml

* Made some TextStyle const

* Added LineStyle to MAIndicatorConfig

* Override getSeries class to get indicator series from ticks

* supportedFieldTypes in IndicatorConfig

* Revert back analysis_options deletion :/

* Removed Indicator inreface. all subclass of AbstractIndicator

* Renamed AbstractIndicator to Indicator

* Code cleanup

* Fix Indicator doc

* Removed BollingerBandsMiddleIndicator

* Added a TODO

* Minor refactor in Highest|LowestValueIndicator

* Minor fix in HighestValueIndicator

* Deleted Ichimoku_indicators file, will be added in later PRs

* Remove generic type for indicators
Will be added later if found it useful

* Fix main.dart

* Delete /l10n.dart~Stashed

* Added a comment

* Rustem/Data fit (#66)

* Update dependencies

* Optional loading animation

* Dummy data  fit button

* Start with 50 for testing

* Data fit flag

* Refactor nested if

* Introduce viewing mode

* Improve doc

* Add simple mode

* rename

* Remove unused getter

* Use viewing mode

* Hide datafit on loading

* Use viewing mode

* Reorder

* Start x axis in data fit mode when enabled

* Only show datafit button if enabled by user

* Draw material spash above grid lines

* Extract method and fix lints

* Add const

* Position left candle

* Add todo

* Add last entry getter

* Adjust zoom on data fit

* Better var name

* Adjust left padding to match design

* Fix animation glitch

* Reduce min candle/interval width limit

* Fit live data

* Remove todo

* Exit data fit on manual input

* Better var name

* Clean up

* Wire up the button

* Disable data fit once cannot zoom out

* Fix data fit switch to following  cur tick

* Make private

* Use last entry

* Min candle duration utility

* Export util function

* Revert analyzer

* Add todo

* Amir/fix lint doc warnings (#71)

* add misc docs

* fix: add documentation to all necessary parts

* fix: remove month const which was referenced from calc_time_grid

* fix: fix compile error for calc-time_grid_test

* Update lib/src/widgets/market_selector/models.dart

Co-authored-by: raminvakili-fs <[email protected]>

* fix: fix reviews

* fix: perform reviews

* fix: add dots to the end of all docs

* fix: resolve reviews

* fix: resolve reviews

* fix: resolve merge issues.

* fix: resolve review issues

* Update lib/src/crosshair/crosshair_details.dart

Co-authored-by: raminvakili-fs <[email protected]>

* Update lib/src/crosshair/crosshair_area.dart

Co-authored-by: raminvakili-fs <[email protected]>

* Update lib/src/markers/animated_active_marker.dart

Co-authored-by: raminvakili-fs <[email protected]>

* Update lib/src/models/candle_painting.dart

Co-authored-by: raminvakili-fs <[email protected]>

* Update lib/src/markers/marker_area.dart

Co-authored-by: raminvakili-fs <[email protected]>

* Update lib/src/chart.dart

Co-authored-by: Rustem Kakimov <[email protected]>

Co-authored-by: raminvakili-fs <[email protected]>
Co-authored-by: Rustem Kakimov <[email protected]>

* Fix_NPE_in_ChartPainter (#70)

* Fix NPE in ChartPainter

* Added null check in ChartDataPainter

* samin/highest_lowest_indicator_unit_tests (#74)

* finish tests

* remove round function

* samin/remove_time_dependency (#68)

* remove time dependency

* fix animation problem

* fix review comments

* minor changes

* minor changes

* fix a bug

* Add animated builder (#81)

* Ramin/Added_CRASH_BOOM_STEP_pngs (#83)

* Added some CRASH, BOOM, STEP, pngs

* Update deprecated annot

* Removed SVGs and SymbolSVGPicture

* Update deriv_chart.dart

* Ramin/fix_assets_upper_lower_case_issue (#84)

* Made all symbols PNGs lowercase

* Added toLowerCase getSymbolAssetPath

* Rustem/Fix crosshair bug (#77)

* Force update on move

* Allow gestures to pass through connection status label

* Arrow func

* samin/barrier_label_repaint (#64)

* add shouldRepaint method to barriers

* add dd curly bracket

* working on..

* working on

* add more checks

* revert analysis_options.yaml

* fix reeview comments

* fix shouldRepaint in barrirs

* fix shouldRepaint in barrirs

* add more logic to shouldRepaint in ChartAnnotation

* minor change

* remove extra logic

* remove vetically in range checking

* merge with dev

* fix review comments

* samin/add_ohlc4_hlc3_hlcc4_indicators_and_test (#73)

* add ohcl indicators and their tests

* finish tests

* add rounded value

* remove extra 0

* fix review comments

* get List<OHLC>  instead of List<Tick>

* remove paddinf from indicator item

* minor change

* Rustem/min_max_calc_optimization (#69)

* Init

* Pass type

* Improve docs

* Grammar

* Grammar 2

* Params and getters

* Constructor

* Update entries method

* Better var name

* Docs

* Interface stub

* Add entry interface

* Remove interface

* Add splay tree map

* Simplify constructor

* Temp check lint

* Import collection

* Fix template

* Implement min and max getters

* Init map

* Add todo

* Initialize splay tree map on the first update

* Plan update of visible entries

* Init lists

* Add no overlap stub

* Resolve todo

* Fully recalc map if no overlap

* Handle empty lists

* Handle option A

* Handle option B and overlap case

* Handle new visible entries being null

* Outline possible options of overlap

* Pin point scroll option

* Pin point zoom cases

* Init test

* Implement min/max entry interface on tick

* Implements keyword

* Annotate

* Implement min/max interface on candle

* Test min/max calc on initial entries

* Increase test complexity

* Fix lints

* Fix remaining lint

* Simplify docs

* Remove todo

* Handle empty new entries

* Handle empty visible entries

* Better doc

* Outline solution

* Remove old left entries

* Remove old right entries

* Add new left/right entries

* Remove old comments

* Update map with added entries

* Remove entries from map

* Test adding identical entries twice

* Test  scrolling forward by 1

* Fix adding new entries

* Extract increment count  operation

* Extract decrement count  operation

* More specific test name

* Test updating max on scrolling forward

* Test min/max when scrolled forward by 2

* Test updating min on scrolling back

* Pass the test

* Test updating max when scrolling back

* Test updating min/max on scrolling backward by 2

* Test updating min/max on zooming in

* Test updating min/max on zooming out

* Update doc

* Use calculator  inside data series

* Update visible entries inside calculatopr

* Revert analyzer changes

* Update lib/src/logic/min_max_calculator.dart

Co-authored-by: raminvakili-fs <[email protected]>

* Repaint on series type change

* Remove entry interface from min/max calc

* Remove min/max interface from candle

* Remove min/max interface from tic

* Use min/maxValueOf in calc

* Pass min/max func to calculator

* Add doc to calc prop

* Rename method and better docs

* Fix tests

Co-authored-by: raminvakili-fs <[email protected]>

* Amir/fix-crosshair-lint-warnings (#79)

* fix: fix crosshair lint warnings

* fix: resolve reviews

* Amir/add-variance-and-standard-deviation-indicator-unit-test (#…
ramin-deriv added a commit that referenced this pull request Oct 17, 2023
* feat: expose chart scaling

* feat: web adapter init

* chore: add models

* chore: fix lint issues

* chore: fix issue with map

* chore: fix map issue 2

* chore: update light theme colors

* feat: integrate multiplier barrier and shade

* feat: draggable barrier - relative and absolute

* feat: add web markers support

* feat: contract replay painter

* chore: add interops and callbacks

* chore: add util functions

* chore: add flag to hide crosshair

* chore: active marker drawing and update end icon

* Revert "feat: draggable barrier - relative and absolute"

This reverts commit 0ecba93.

* Revert "feat: integrate multiplier barrier and shade"

This reverts commit 49fa8a8.

* chore: fix instance issue

* fix: marker drawings

* refactor: start and end markers

* chore: add digit contract toggle

* refactor: tick points

* chore: fix quote grid initial render

* refactor: chart options

* add indicatorsRepo

* fix: order of repaint check

* chore: add id to indicators

* fix: ambiguous import issue

* chore: indicator integration

* refactor: add dart interop

* refactor: interop

* chore: remove web_adapter

* chore: show y-axis on indicators

* chore: remove unused import

* chore: add id to series

* feat: add bottom chart options

* chore: add crosshair callbacks

* chore: update dataFitMode

* chore: show icons if the prop is null

* refactor: remove unused code

* refactor: marker and crosshair

* fix: series type comparison

* fix: review comments

* refactor: remove painters related to web charts

* refactor: remove web marker paintings

* refactor: remove web related props

* chore: remove bool compare

* chore: add repository interface

* refactor: modify to interface

* add maxCurrentTickOffset config

* chore: remove id

* refactor: indicator repository

* chore: add bar style to gator

* chore: remove id from indicator config

* chore: generate g.dart files

* chore: macd add configs

* chore: add roc line style

* chore: add linestyle to StochasticOscillator

* chore: add linestyle to william r indicator

* chore: add color config to aroon indicator

* chore: add ADX configs

* chore: add ichimoku line styles

* chore: add bollinger line styles

* chore: add linestyle to ma env

* chore: add line style to alligator

* chore: remove id form add on

* chore: update bollinger bands colors

* refactor: remove marker area changes

* refactor: update to _getIndicatorSeries

* chore: add createAddOn callback

* chore: add title to the indicator

* chore: sort out review comments

* feat: add expand/collapse and move icons

* fix: null exception on delete indicator

* chore: remove unnecessary non-nullable type

* fix: pinch-to-zoom

* fix: add missing title to dpo

* chore: hide move icons when expanded

* fix: builds the widget after animation to render the y-axis correctly

* fix: pinch to zoom on mobile

* refactor: make functions in repository consistent

* chore: add linestyle to dpo indicator

* chore: update crosshair doc

* refactor: update to repo interface

* Bug fixes 1 (#12)

* chore: exposes scrollBy function

* chore: customize msPerPx and leftMargin

* chore: add second intervals

* chore: configuration to change rainbow colors

* Ahmad/78749/Drawing tool- Horizontal

* Ahmad/78749/Drawing tool- Horizontal

* adding constant file

* removing the horizontal tool functionality

* chore: expore series and indicator configs

* chore: make line series public inorder to access it from outside the chart

* chore: expose indicator series and fix williams oscillator series

* chore: expose indicator series

* fix: bottom title for dark theme

* chore: expose make series and configs

* fix: wrap expandedIndex in setState

* fix: channel fill for bollinger and donchian

* fix: check shouldUpdate for series to draw it when the config is changed

* chore: add shouldRepaint override for MA Series

* chore: fix bottom chart title color

* chore: modify candle colors for light theme

* fix: theme text

* chore: fix theme text

* fix: html mode barrier painting

* fix for endIndex

* removing stashed data

* day seperator

* revert zigzag fix

* chore: remove candle style here

* changing color to theme color

* formatting

* chore: add showLastIndicator config

* chore: add pipsize for bottom indicators

* chore: add last indicator alligator

* chore: add pipsize to indicators #2

* chore: add pipsize and lastindicatorstyle to idnicators #3

* chore: add pipsize and lastindicatorstyle to indicators #4

* chore: add last indicator style for overlay indicators

* chore: add fcb configs

* refactor: timestamp variable

* chore: add adx shading

* chore: fix y-axis labels

* Ahmad/Adx Indicator fix (#11)

* smi fix

* adx and gator

* chore: add container to get height and width from size

* chore: revert startWithDataFitMode

* chore: add showDataFitButton and animation props

* chore: add padding and margin to props

* revert: vertical padding

* chore: expose verticalPaddingFraction

* fix: isLive issue

* chore: revert changes

* chore: customize minIntervalWidth

* chore: remove showLoadingAnimationForHistoricalData customization.

* chore: move assets to different package

* refactor: controller fn

* chore: get current msPerPx

* Revert "chore: move assets to different package"

This reverts commit be7fea8.

* chore: add maxIntervalWidth

* chore: add loading animation color

* chore: add condition to show scroll to recent button

* chore: call onScale update

* chore: crosshair related changes

---------

Co-authored-by: Ahmad Taimoor <ahmadtaimoor@Ahmad-Taimoor-Suddles-MacBook-Pro-C02YN1TNJGH6.local>
Co-authored-by: ahmadtaimoor-deriv <[email protected]>

* chore: remove unused import

* chore: add line styles for rainbow indicator

* fix: merge issues

* chore: add assert to RainbowIndicatorConfig

* feat: add combinePaths function

* chore: update document

* Update lib/src/deriv_chart/chart/data_visualization/helpers/find_intersection.dart

Co-authored-by: ramin-deriv <[email protected]>

* chore: add animation dependency to marker area

* chore: add minElapsedTimeToFollow prop

* chore: add props to customize animation duration and to show blink animation

* chore: update distant constant to fix flickering issue

* fix: indicator exception on selecting MovingAverageType

* fix: duplicate import

* refactor: make duration props non nullable

* fix: expanded index when bottom indicator is removed

---------

Co-authored-by: balakrishna-binary <[email protected]>
Co-authored-by: Ahmad Taimoor <ahmadtaimoor@Ahmad-Taimoor-Suddles-MacBook-Pro-C02YN1TNJGH6.local>
Co-authored-by: ahmadtaimoor-deriv <[email protected]>
Co-authored-by: ramin-deriv <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants