GithubHelp home page GithubHelp logo

rainbow-me / react-native-animated-charts Goto Github PK

View Code? Open in Web Editor NEW
907.0 15.0 108.0 4.62 MB

Set of components and helpers for building complex and beautifully animated charts

License: MIT License

JavaScript 86.00% Starlark 1.41% Java 5.13% Objective-C++ 3.37% Objective-C 3.27% Ruby 0.56% Shell 0.25%
charts react native react-native animations reanimated2 reanimated

react-native-animated-charts's Introduction

React Native Animated Charts

Set of components and helpers for building complex and beautifully animated charts.

The library was designed to create aesthetic, animated (so far only linear) charts based on a given input. The main assumptions of the library were to create smooth transitions between subsequent data sets. For this reason, we have discovered a shortage of existing libraries related to the charts. The current package was created as part of the Rainbow.me project and for this reason it was not designed as a complete and comprehensive solution for displaying various types of charts. However, we will be now using more charts in the whole application, so we believe that the number of functionalities in the application will gradually grow.

Additionally, we are open to new Pull Requests. We want this library to become popular and complete thanks to community activity.

It's a part of the Rainbow.me project.

Installation

  1. Install react-native-reanimated in the newest version.
yarn add @rainbow-me/animated-charts

The library has been verified with 2.0.0-alpha.6 version of reanimated.

Reanimated

Using TurboModules might have an impact on your current development flow and most likely you don't want to decrease your DX. Since we're not using reanimated in other places in the app, we made some tweaks to disable charts in development mode with compilation macros on iOS. You can find it here

Also, because we're using libraries which currently do not support reanimated 2, we patched exports in reanimated

Furthermore, we found few differences in how the Animated module works with and without TurboModules support, so we made a trick to fallback to the not-TM version of Animated.

Most likely, you don't need any of those patches.

Example app

We made a generic example to show briefly what's possible to achieve with this library. A Real-life example is available inside Rainbow!

In order to run an example clone this repo and navigate to Example then:

yarn && cd ios && pod install && cd ..
react-native run-android
react-native run-ios

API

The library has been designed to provide as much flexibility as possible with the component-based API for easy integration with existing applications.

Basic API Example

import React from 'react';
import {Dimensions, View} from 'react-native';
import {ChartDot, ChartPath, ChartPathProvider, monotoneCubicInterpolation} from '@rainbow-me/animated-charts';

export const {width: SIZE} = Dimensions.get('window');

export const data = [
  {x: 1453075200, y: 1.47}, {x: 1453161600, y: 1.37},
  {x: 1453248000, y: 1.53}, {x: 1453334400, y: 1.54},
  {x: 1453420800, y: 1.52}, {x: 1453507200, y: 2.03},
  {x: 1453593600, y: 2.10}, {x: 1453680000, y: 2.50},
  {x: 1453766400, y: 2.30}, {x: 1453852800, y: 2.42},
  {x: 1453939200, y: 2.55}, {x: 1454025600, y: 2.41},
  {x: 1454112000, y: 2.43}, {x: 1454198400, y: 2.20},
];

const points = monotoneCubicInterpolation({data, range: 40});

const BasicExample = () => (
  <View style={{ backgroundColor: 'black' }}>
    <ChartPathProvider data={{ points, smoothingStrategy: 'bezier' }}>
      <ChartPath height={SIZE / 2} stroke="yellow" width={SIZE} />
      <ChartDot style={{ backgroundColor: 'blue' }} />
    </ChartPathProvider>
  </View>
);

The code above generates the chart below:

Linear charts

ChartPathProvider

The whole chart's structure has to be wrapped with ChartProvider. It's responsible for data managing and itself does not have a visual impact on the layout. Under the hood, it uses context API to simplify manipulation with other components. The rule is to use one data series for each wrapper. It's important to have it as a separated component because under this component it's possible useChartData hook and put ChartDot component. However, if you don't need those features, you can pass data directly to ChartPath and drop this wrapper.

Prop name type default / obligatory description
data { points: [Point], nativePoints: [Point], smoothingStrategy?: 'bezier'|'simple'|'complex', smoothingFactor } obligatory Object containing data structure and way to display them. Each of the properties is explained below.
  • points is an array containing Points to be displayed. A Point is an object containing x and y as a number.
  • originalData is an array of points that will not be drawn. However, if you used some strategy of interpolating data or simplifying you might want to present data slightly different from the real one. Then if you'd like labels to be fully correct you may want to provide real data before adjusting them.
  • smoothingStrategy. While presenting points path can be drawn with different approaches.
    • If smoothingStrategy is not provided (or set to any other value but for listed here), connects points using linear interpolation.
    • The bezier strategy connects points with a bezier path inspired by d3 shape. It's not parametrized by smoothingFactor.
    • The complex strategy uses approach explained here using cubic splines. It's parametrized by smoothingFactor.
    • The simple strategy is a bit simplified complex strategy using quadratic splines. It's parametrized by smoothingFactor.
  • smoothingFactor. Is a value from 0 to 1 defining how smooth a presentation should be. 0 means no smoothing, and it's the default. smoothingFactor has an impact if smoothingStrategy is simple or complex.
  • yRange. 2-elements array with numbers describing minY and maxY in this order. When not applied, charts are automatically adjusted vertically. However, when data are monotonical, they might present incorrectly without bounding due to numerical issues.

ChartPath

This component is used for showing the path itself.

Prop name type default / obligatory description
smoothingWhileTransitioningEnabled number false Although smoothing is not complex computing, it might impact performance in some low-end devices so while having a big set of data it might be worth disable smoothing while transitioning.
height number obligatory Height od the SVG canvas
width number obligatory Width od the SVG canvas
strokeWidth number 1 Width of the path.
selectedStrokeWidth number 1 Width of the path selected.
gestureEnabled boolean true Defines if interaction with the chart should be allowed or not
longPressGestureHandlerProps object {maxDist: 100000, minDurationMs: 0, shouldCancelWhenOutside: false} Under the hood we're using LongPressGestureHandler for handling interactions. It's recommended to not override its props. However, it might be useful while interacting with another GH.
selectedOpacity number 0.7 Target opacity of the path while touching the chart.
hitSlop number 0 While scrubbing the chart touching edges of the screen you may want make points on the edges more accessible. With hitSlop it's possible to access points on edges doubling the speed of scrubbing beyond this margin.
hapticsEnabled boolean false On pressing in/out on the chart it might be expected to make haptic feedback. It will happen with hapticsEnabled set to true.
springConfig object {damping: 15, mass: 1, stiffness: 600} Object defining the spring animation. This spring is used for a dot's scale.
timingFeedbackConfig object {duration: 80} Object defining the timing animation. timingFeedbackConfig is used for a path's opacity and width.
timingAnimationConfig object {duration: 300} Object defining the timing animation. timingAnimationConfig is used for the transition between chart's data.
...rest object {} Props applied to SVG Path.

ChartDot

Component for displaying the dot for scrubbing on the chart.

Prop name type default description
size number 10 Size of the dot.
...props object {} Rest of the props applied to Reanimated.View including style

ChartYLabel & ChartXLabel

Labels are useful while moving finger through the chart to show the exact value in given point.

Prop name type default description
format reanimated worklet a => a Worklet for formatting data from the chart. It can be useful when your data is a timestamp or currency.
...props object {} Rest of the props applied to TextInput including style

CurrentPositionVerticalLine & OpeningPositionHorizontalLine

CurrentPositionVerticalLine is a vertical line moving with user's finger through chart.

OpeningPositionHorizontalLine is a horizontal static line on height of the first point.

Prop name type default description
color string #000000 Color of the line.
thickness number 2 Thickness of the line.
length number null Length of the line.
...props object {} Rest of the props applied to svg's Line.

Candle Charts

TODO

Pie charts

TODO

Helpers

It's not essential in the library, but we have decided to include a lot of helpers we are (or we were) using for displaying charts.

Interpolations

We have two interpolators which share the most of the API: bSplineInterpolation and monotoneCubicInterpolation.

import { bSplineInterpolation as interpolator } from '@rainbow-me/animated-charts';
// import { monotoneCubicInterpolation as interpolator } from '@rainbow-me/animated-charts';

const interpolatedData = interpolator({data, range: 80});

Code above generates 80 equidistant points from given dataset. Generator accepts object of parameters as an argument:

  • data - input of points.

  • range is the number of points of the output.

  • includeExtremes. If it's vital to include extremes in the output, set to true. However, the data might not be fully equidistant.

  • removePointsSurroundingExtremes. Makes sense only if includeExtremes set to true. When disabled, it might be possible that extremes look very "pointy". To get rid of this, you can remove points surrounding extremes. E.g.

    • removePointsSurroundingExtremes = false

      o---------o----Min--o---------o---------o---------o---------o

    • removePointsSurroundingExtremes = true

      o--------------Min------------o---------o---------o---------o

bSplineInterpolation({ degree = 3, ...params })

bSplineInterpolation is inspired by victorian lib and uses B-spline interpolation of a given degree.

monotoneCubicInterpolation({ ...params })

This curve is inspired by d3 shape. "Produces a cubic spline that preserves monotonicity in y, assuming monotonicity in x, as proposed by Steffen in A simple method for monotonic interpolation in one dimension: “a smooth curve with continuous first-order derivatives that passes through any given set of data points without spurious oscillations. Local extrema can occur only at grid points where they are given by the data, but not in between two adjacent grid points.”

simplifyData(data, pickRange = 10, includeExtremes = true)

This helper takes only one point per pickRange. Might be useful for very dense data. If it's important, it's possible to include extremes with the includeExtremes flag. E.g.

pickRange = 3, includeExtremes = true

X are equidistant in this case

Y:0          1          7          2         -3          0          1          2
  S----------o----------E----------X----------E----------o----------X----------o----------S

X - points picked because index%3=0

S – the first and the last points are always included.

E – extremes.

useChartData

It's a bit advanced hook and contains information about current position of dot and corresponding values. Content of the result is changing often, so it's not worth deep documentation now.

TODO

The library has been released in a production-ready version. We use it inside the Rainbow.me project so it's verified for use in production. However, it relies on React Native Reanimated 2.0 in the alpha version thus it might not work perfectly. Test it deeply before using it. Until the stable release of Reanimated 2, I think it's worth not marking this library as stable. Although the library works with Reanimated without any changes, we faced a few issues related to our (quite advanced) usage of the library. Thus we made some hacks we're not very proud of and it's for 99% something you should not do. However, if you see some crashes, you may try one of our hacks.

There're a few things left to make it polished regarding linear charts:

  • Support for gestures - pinching, swiping, etc.
  • more parameters regarding interpolation, smoothing, and animations (i.e. allow to override springConfig and timingConfig)

License

Reanimated library is licensed under The MIT License.

react-native-animated-charts's People

Contributors

ajimae avatar dynamichny avatar eridr avatar osdnk avatar outatime avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-animated-charts's Issues

hapticsEnabled does not work

<ChartPath
height={SIZE / 3}
width={SIZE}
stroke="#ffa694"
strokeWidth={3.5}
selectedStrokeWidth={3}
hapticsEnabled
smoothingWhileTransitioningEnabled={.5}
/>

error:
Tried to synchronously call anonymous function from a different thread.

Occurred in worklet location: ...../@rainbow-me/animated-charts/src/charts/linear/ChartPath.js (26:0)

Possible solutions are:
a) If you want to synchronously execute this method, mark it as a Worklet
b) If you want to execute this method on the JS thread, wrap it using runOnJS

How to get the values of the current dot position

I have been looking around on how to extract the values of the dot position. From the documentation, it was briefly stated that the useChartData is an advanced hook which for obvious reason cannot be documented just yet. So I would like to know if there is any other way to extract the data from the ChartPath.

Thanks

formatting issue

Hi All
When I try to formate date using dayjs or when I try to format currency using Intl.NumberFormat()
I've got the following error

Code sample
image

Could anyone help what to do?

image

How to initialize the linechart to be a straight line?

I was wondering if there is a way to create a straight line in middle before the data loads? I have tried a bunch of data points to get the effect, but i couldn't. So, I was wondering if someone using this library have some pointers?

Can't use currency symbols in labels on Android

First off, thank you for open sourcing this great library, much appreciated.

I am having an issue with the returned currency symbols inside the ChartXLabel or ChartYLabel worklet on Android. Getting weird characters back. Check the screenshot, just took your GenericExample and returning "€" inside formatUSD function. Only the dollar is returned as is. Only happens on Android. Where does this limitation in the charset comes from? And can this be fixed?

Screenshot 2021-02-16 at 15 17 56

InvalidNumber error after update to [email protected]

Hi @osdnk,

Today I updated my application to the expo SDK40 that includes the version 2.0.0-rc.0 of react-native-reanimated and I am having this wired error, by any chance these charts are compatible with this version of reanimated? rainbow.me have me a more updated version of these charts?

Note: The react-native-svg version did not change it is exactly the same as it had when everything worked perfectly with [email protected].

Thanks and any help will be very useful, I attach the trace:

InvalidNumber: M NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,NaN C NaN,NaN NaN,NaN NaN,NaN C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C -Infinity,-Infinity -Infinity,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C Infinity,-Infinity Infinity,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,-Infinity C NaN,-Infinity NaN,-Infinity NaN,NaN C NaN,NaN NaN,NaN NaN,NaN C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity C NaN,Infinity NaN,Infinity NaN,Infinity CNaN,Infinity NaN,Infinity NaN,Infinity

-[ABI40_0_0RNSVGPathParser parse_number]
    ABI40_0_0RNSVGPathParser.m:543
-[ABI40_0_0RNSVGPathParser parse_list_number]
-[ABI40_0_0RNSVGPathParser getPath]
-[ABI40_0_0RNSVGPath setD:]
__58-[ABI40_0_0RCTComponentData createPropBlock:isShadowView:]_block_invoke.89
__58-[ABI40_0_0RCTComponentData createPropBlock:isShadowView:]_block_invoke_2.90
__46-[ABI40_0_0RCTComponentData setProps:forView:]_block_invoke
__NSDICTIONARY_IS_CALLING_OUT_TO_A_BLOCK__
-[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:]
-[ABI40_0_0RCTComponentData setProps:forView:]
-[ABI40_0_0RCTUIManager synchronouslyUpdateViewOnUIThread:viewName:props:]
-[ABI40_0_0REANodesManager updateProps:ofViewWithTag:withName:]
std::__1::__function::__func<ABI40_0_0reanimated::createReanimatedModule(std::__1::shared_ptr<ABI40_0_0facebook::ABI40_0_0React::CallInvoker>)::$_0, std::__1::allocator<ABI40_0_0reanimated::createReanimatedModule(std::__1::shared_ptr<ABI40_0_0facebook::ABI40_0_0React::CallInvoker>)::$_0>, void (ABI40_0_0facebook::jsi::Runtime&, int, ABI40_0_0facebook::jsi::Value const&, ABI40_0_0facebook::jsi::Object const&)>::operator()(ABI40_0_0facebook::jsi::Runtime&, int&&, ABI40_0_0facebook::jsi::Value const&, ABI40_0_0facebook::jsi::Object const&)
std::__1::__function::__func<ABI40_0_0reanimated::RuntimeDecorator::addNativeObjects(ABI40_0_0facebook::jsi::Runtime&, std::__1::function<void (ABI40_0_0facebook::jsi::Runtime&, int, ABI40_0_0facebook::jsi::Value const&, ABI40_0_0facebook::jsi::Object const&)>, std::__1::function<void (std::__1::function<void (double)>)>, std::__1::function<void (int, double, double, bool)>, std::__1::function<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double> > > (int)>, std::__1::function<double ()>)::$_2, std::__1::allocator<ABI40_0_0reanimated::RuntimeDecorator::addNativeObjects(ABI40_0_0facebook::jsi::Runtime&, std::__1::function<void (ABI40_0_0facebook::jsi::Runtime&, int, ABI40_0_0facebook::jsi::Value const&, ABI40_0_0facebook::jsi::Object const&)>, std::__1::function<void (std::__1::function<void (double)>)>, std::__1::function<void (int, double, double, bool)>, std::__1::function<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double> > > (int)>, std::__1::function<double ()>)::$_2>, ABI40_0_0facebook::jsi::Value (ABI40_0_0facebook::jsi::Runtime&, ABI40_0_0facebook::jsi::Value const&, ABI40_0_0facebook::jsi::Value const*, unsigned long)>::operator()(ABI40_0_0facebook::jsi::Runtime&, ABI40_0_0facebook::jsi::Value const&, ABI40_0_0facebook::jsi::Value const*&&, unsigned long&&)
std::__1::function<ABI38_0_0facebook::jsi::Value (ABI38_0_0facebook::jsi::Runtime&, ABI38_0_0facebook::jsi::Value const&, ABI38_0_0facebook::jsi::Value const*, unsigned long)>::operator()(ABI38_0_0facebook::jsi::Runtime&, ABI38_0_0facebook::jsi::Value const&, ABI38_0_0facebook::jsi::Value const*, unsigned long) const
ABI40_0_0facebook::jsc::JSCRuntime::createFunctionFromHostFunction(ABI40_0_0facebook::jsi::PropNameID const&, unsigned int, std::__1::function<ABI40_0_0facebook::jsi::Value (ABI40_0_0facebook::jsi::Runtime&, ABI40_0_0facebook::jsi::Value const&, ABI40_0_0facebook::jsi::Value const*, unsigned long)>)::HostFunctionMetadata::call(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**)
JSC::JSCallbackObject<JSC::JSNonFinalObject>::call(JSC::JSGlobalObject*, JSC::CallFrame*)
JSC::LLInt::setUpCall(JSC::CallFrame*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*)
llint_entry
vmEntryToJavaScript
JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
JSObjectCallAsFunction
ABI40_0_0facebook::jsc::JSCRuntime::call(ABI40_0_0facebook::jsi::Function const&, ABI40_0_0facebook::jsi::Value const&, ABI40_0_0facebook::jsi::Value const*, unsigned long)
std::__1::__function::__func<ABI40_0_0reanimated::ShareableValue::toJSValue(ABI40_0_0facebook::jsi::Runtime&)::$_2, std::__1::allocator<ABI40_0_0reanimated::ShareableValue::toJSValue(ABI40_0_0facebook::jsi::Runtime&)::$_2>, ABI40_0_0facebook::jsi::Value (ABI40_0_0facebook::jsi::Runtime&, ABI40_0_0facebook::jsi::Value const&, ABI40_0_0facebook::jsi::Value const*, unsigned long)>::operator()(ABI40_0_0facebook::jsi::Runtime&, ABI40_0_0facebook::jsi::Value const&, ABI40_0_0facebook::jsi::Value const*&&, unsigned long&&)
std::__1::function<ABI38_0_0facebook::jsi::Value (ABI38_0_0facebook::jsi::Runtime&, ABI38_0_0facebook::jsi::Value const&, ABI38_0_0facebook::jsi::Value const*, unsigned long)>::operator()(ABI38_0_0facebook::jsi::Runtime&, ABI38_0_0facebook::jsi::Value const&, ABI38_0_0facebook::jsi::Value const*, unsigned long) const
ABI40_0_0facebook::jsc::JSCRuntime::createFunctionFromHostFunction(ABI40_0_0facebook::jsi::PropNameID const&, unsigned int, std::__1::function<ABI40_0_0facebook::jsi::Value (ABI40_0_0facebook::jsi::Runtime&, ABI40_0_0facebook::jsi::Value const&, ABI40_0_0facebook::jsi::Value const*, unsigned long)>)::HostFunctionMetadata::call(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**)
JSC::JSCallbackObject<JSC::JSNonFinalObject>::call(JSC::JSGlobalObject*, JSC::CallFrame*)
JSC::LLInt::setUpCall(JSC::CallFrame*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*)
llint_entry
vmEntryToJavaScript
JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
JSObjectCallAsFunction
ABI40_0_0facebook::jsc::JSCRuntime::call(ABI40_0_0facebook::jsi::Function const&, ABI40_0_0facebook::jsi::Value const&, ABI40_0_0facebook::jsi::Value const*, unsigned long)
std::__1::__function::__func<ABI40_0_0reanimated::ShareableValue::toJSValue(ABI40_0_0facebook::jsi::Runtime&)::$_2, std::__1::allocator<ABI40_0_0reanimated::ShareableValue::toJSValue(ABI40_0_0facebook::jsi::Runtime&)::$_2>, ABI40_0_0facebook::jsi::Value (ABI40_0_0facebook::jsi::Runtime&, ABI40_0_0facebook::jsi::Value const&, ABI40_0_0facebook::jsi::Value const*, unsigned long)>::operator()(ABI40_0_0facebook::jsi::Runtime&, ABI40_0_0facebook::jsi::Value const&, ABI40_0_0facebook::jsi::Value const*&&, unsigned long&&)
std::__1::function<ABI38_0_0facebook::jsi::Value (ABI38_0_0facebook::jsi::Runtime&, ABI38_0_0facebook::jsi::Value const&, ABI38_0_0facebook::jsi::Value const*, unsigned long)>::operator()(ABI38_0_0facebook::jsi::Runtime&, ABI38_0_0facebook::jsi::Value const&, ABI38_0_0facebook::jsi::Value const*, unsigned long) const
ABI40_0_0facebook::jsc::JSCRuntime::createFunctionFromHostFunction(ABI40_0_0facebook::jsi::PropNameID const&, unsigned int, std::__1::function<ABI40_0_0facebook::jsi::Value (ABI40_0_0facebook::jsi::Runtime&, ABI40_0_0facebook::jsi::Value const&, ABI40_0_0facebook::jsi::Value const*, unsigned long)>)::HostFunctionMetadata::call(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**)
JSC::JSCallbackObject<JSC::JSNonFinalObject>::call(JSC::JSGlobalObject*, JSC::CallFrame*)
JSC::LLInt::setUpCall(JSC::CallFrame*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*)
llint_entry
vmEntryToJavaScript
JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
JSObjectCallAsFunction
ABI40_0_0facebook::jsc::JSCRuntime::call(ABI40_0_0facebook::jsi::Function const&, ABI40_0_0facebook::jsi::Value const&, ABI40_0_0facebook::jsi::Value const*, unsigned long)
std::__1::__function::__func<ABI40_0_0reanimated::ShareableValue::toJSValue(ABI40_0_0facebook::jsi::Runtime&)::$_2, std::__1::allocator<ABI40_0_0reanimated::ShareableValue::toJSValue(ABI40_0_0facebook::jsi::Runtime&)::$_2>, ABI40_0_0facebook::jsi::Value (ABI40_0_0facebook::jsi::Runtime&, ABI40_0_0facebook::jsi::Value const&, ABI40_0_0facebook::jsi::Value const*, unsigned long)>::operator()(ABI40_0_0facebook::jsi::Runtime&, ABI40_0_0facebook::jsi::Value const&, ABI40_0_0facebook::jsi::Value const*&&, unsigned long&&)
std::__1::function<ABI38_0_0facebook::jsi::Value (ABI38_0_0facebook::jsi::Runtime&, ABI38_0_0facebook::jsi::Value const&, ABI38_0_0facebook::jsi::Value const*, unsigned long)>::operator()(ABI38_0_0facebook::jsi::Runtime&, ABI38_0_0facebook::jsi::Value const&, ABI38_0_0facebook::jsi::Value const*, unsigned long) const
ABI40_0_0facebook::jsc::JSCRuntime::createFunctionFromHostFunction(ABI40_0_0facebook::jsi::PropNameID const&, unsigned int, std::__1::function<ABI40_0_0facebook::jsi::Value (ABI40_0_0facebook::jsi::Runtime&, ABI40_0_0facebook::jsi::Value const&, ABI40_0_0facebook::jsi::Value const*, unsigned long)>)::HostFunctionMetadata::call(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**)
JSC::JSCallbackObject<JSC::JSNonFinalObject>::call(JSC::JSGlobalObject*, JSC::CallFrame*)
vmEntryToNative
JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
JSObjectCallAsFunction
ABI40_0_0facebook::jsc::JSCRuntime::call(ABI40_0_0facebook::jsi::Function const&, ABI40_0_0facebook::jsi::Value const&, ABI40_0_0facebook::jsi::Value const*, unsigned long)
ABI40_0_0reanimated::Mapper::execute(ABI40_0_0facebook::jsi::Runtime&)
ABI40_0_0reanimated::MapperRegistry::execute(ABI40_0_0facebook::jsi::Runtime&)
ABI40_0_0reanimated::NativeReanimatedModule::onRender(double)
invocation function for block in ABI40_0_0reanimated::createReanimatedModule(std::__1::shared_ptr<ABI40_0_0facebook::ABI40_0_0React::CallInvoker>)::$_4::operator()(std::__1::function<void (double)>, ABI40_0_0facebook::jsi::Runtime&) const
-[ABI40_0_0REANodesManager onAnimationFrame:]
CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long)
display_timer_callback(__CFMachPort*, void*, long, void*)
__CFMachPortPerform
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
__CFRunLoopDoSource1
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
-[UIApplication _run]
UIApplicationMain
main
start

Decleration issue when importing @rainbow-me/animated-charts

When I import

import { ChartDot, ChartPath, ChartPathProvider, monotoneCubicInterpolation, } from '@rainbow-me/animated-charts';

I seem to be getting an error saying - "Could not find a declaration file for module '@rainbow-me/animated-charts. Because of that, the graph is not showing.

Whats the best way to pass X and Y values from ChartLabelX and ChartLabelY component's worklet??

I am trying to get the value to render in different place rather than inside ChartLabelX and ChartLabelY component. Using these component at the top of the chart component messes up with charts dot. So I wanted to use the x and y values as global state and render them accordingly.In the documentation it is mentioned that useChartData gives access to those data. So maybe someone can give me some details on how to work with it.

Label not returning zeroes

When data has zeroes label returns undefined and the dot won't show on the right location when the angle get too steeper like this
Screenshot from 2021-01-06 12-15-02
Screenshot from 2021-01-06 12-16-01

[{"x": 1610550427.05901, "y": 0}, {"x": 1610464027.060391, "y": 0}, {"x": 1610377627.061678, "y": 0}, {"x": 1610291227.062755, "y": 0}, {"x": 1610204827.063811, "y": 0}, {"x": 1610118427.064869, "y": 0}, {"x": 1610032027.066217, "y": 0}, {"x": 1609945627.067359, "y": 500}]

Steps to reproduce:

  1. Use simplifyData with the array provided above
    simplifyData(data, 1, true)
  2. Use 95% of the screen width (a card in my case)
  3. Now the angle is to high and the dot is not in the right place

TurboModuleRegistry.getEnforcing(...) Error

Hello,

I have no problem using the library on ios it works perfectly fine, but im not able to use it on android I get this error:

image

Did you encounter this error yet ?

Thank you for any help

ChartXlabel and ChartYLabel are not displaying while dragging on the path.

In the initial run, I got this error.
Then after the subsequent run error doesn't get display anymore.

Screenshot 2020-11-26 at 14 46 10

Tried to synchronously call function {getX} from a different thread.
Solution is:
a) If you want to synchronously execute this method, mark it as a Worklet
b) If you want to execute this method on the JS thread, wrap it using runOnJS


reanimated::REAIOSErrorHandler::raiseSpec()
    REAIOSErrorHandler.mm:17
reanimated::ErrorHandler::raise()::'lambda'()::operator()()
decltype(std::__1::forward<reanimated::ErrorHandler::raise()::'lambda'()&>(fp)()) std::__1::__invoke<reanimated::ErrorHandler::raise()::'lambda'()&>(reanimated::ErrorHandler::raise()::'lambda'()&)
void std::__1::__invoke_void_return_wrapper<void>::__call<reanimated::ErrorHandler::raise()::'lambda'()&>(reanimated::ErrorHandler::raise()::'lambda'()&)
std::__1::__function::__alloc_func<reanimated::ErrorHandler::raise()::'lambda'(), std::__1::allocator<reanimated::ErrorHandler::raise()::'lambda'()>, void ()>::operator()()
std::__1::__function::__func<reanimated::ErrorHandler::raise()::'lambda'(), std::__1::allocator<reanimated::ErrorHandler::raise()::'lambda'()>, void ()>::operator()()
std::__1::__function::__value_func<void ()>::operator()() const
std::__1::function<void ()>::operator()() const
reanimated::REAIOSScheduler::scheduleOnUI(std::__1::function<void ()>)
reanimated::ErrorHandler::raise()
reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_0::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const
decltype(std::__1::forward<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_0&>(fp)(std::__1::forward<facebook::jsi::Runtime&>(fp0), std::__1::forward<facebook::jsi::Value const&>(fp0), std::__1::forward<facebook::jsi::Value const*>(fp0), std::__1::forward<unsigned long>(fp0))) std::__1::__invoke<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_0&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long>(reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_0&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&)
facebook::jsi::Value std::__1::__invoke_void_return_wrapper<facebook::jsi::Value>::__call<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_0&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long>(reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_0&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&)
std::__1::__function::__alloc_func<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_0, std::__1::allocator<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_0>, facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&)
std::__1::__function::__func<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_0, std::__1::allocator<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_0>, facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&)
std::__1::__function::__value_func<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&) const
std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const
facebook::jsc::JSCRuntime::createFunctionFromHostFunction(facebook::jsi::PropNameID const&, unsigned int, std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>)::HostFunctionMetadata::call(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**)
JSC::JSCallbackObject<JSC::JSNonFinalObject>::call(JSC::JSGlobalObject*, JSC::CallFrame*)
JSC::LLInt::setUpCall(JSC::CallFrame*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*)
llint_entry
vmEntryToJavaScript
JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
JSObjectCallAsFunction
facebook::jsc::JSCRuntime::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)
facebook::jsi::Function::callWithThis(facebook::jsi::Runtime&, facebook::jsi::Object const&, facebook::jsi::Value const*, unsigned long) const
reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_2::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)
decltype(std::__1::forward<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_2&>(fp)(std::__1::forward<facebook::jsi::Runtime&>(fp0), std::__1::forward<facebook::jsi::Value const&>(fp0), std::__1::forward<facebook::jsi::Value const*>(fp0), std::__1::forward<unsigned long>(fp0))) std::__1::__invoke<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_2&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long>(reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_2&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&)
facebook::jsi::Value std::__1::__invoke_void_return_wrapper<facebook::jsi::Value>::__call<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_2&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long>(reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_2&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&)
std::__1::__function::__alloc_func<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_2, std::__1::allocator<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_2>, facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&)
std::__1::__function::__func<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_2, std::__1::allocator<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_2>, facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&)
std::__1::__function::__value_func<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&) const
std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const
facebook::jsc::JSCRuntime::createFunctionFromHostFunction(facebook::jsi::PropNameID const&, unsigned int, std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>)::HostFunctionMetadata::call(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**)
JSC::JSCallbackObject<JSC::JSNonFinalObject>::call(JSC::JSGlobalObject*, JSC::CallFrame*)
JSC::LLInt::setUpCall(JSC::CallFrame*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*)
llint_entry
vmEntryToJavaScript
JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
JSObjectCallAsFunction
facebook::jsc::JSCRuntime::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)
facebook::jsi::Function::callWithThis(facebook::jsi::Runtime&, facebook::jsi::Object const&, facebook::jsi::Value const*, unsigned long) const
reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_2::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)
decltype(std::__1::forward<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_2&>(fp)(std::__1::forward<facebook::jsi::Runtime&>(fp0), std::__1::forward<facebook::jsi::Value const&>(fp0), std::__1::forward<facebook::jsi::Value const*>(fp0), std::__1::forward<unsigned long>(fp0))) std::__1::__invoke<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_2&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long>(reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_2&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&)
facebook::jsi::Value std::__1::__invoke_void_return_wrapper<facebook::jsi::Value>::__call<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_2&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long>(reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_2&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&)
std::__1::__function::__alloc_func<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_2, std::__1::allocator<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_2>, facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&)
std::__1::__function::__func<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_2, std::__1::allocator<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_2>, facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&)
std::__1::__function::__value_func<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&) const
std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const
facebook::jsc::JSCRuntime::createFunctionFromHostFunction(facebook::jsi::PropNameID const&, unsigned int, std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>)::HostFunctionMetadata::call(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**)
JSC::JSCallbackObject<JSC::JSNonFinalObject>::call(JSC::JSGlobalObject*, JSC::CallFrame*)
vmEntryToNative
JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
JSObjectCallAsFunction
facebook::jsc::JSCRuntime::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)
facebook::jsi::Function::callWithThis(facebook::jsi::Runtime&, facebook::jsi::Object const&, facebook::jsi::Value const*, unsigned long) const
facebook::jsi::Function::callWithThis(facebook::jsi::Runtime&, facebook::jsi::Object const&, std::initializer_list<facebook::jsi::Value>) const
facebook::jsi::Value facebook::jsi::Function::callWithThis<>(facebook::jsi::Runtime&, facebook::jsi::Object const&) const
reanimated::Mapper::execute(facebook::jsi::Runtime&)
reanimated::MapperRegistry::execute(facebook::jsi::Runtime&)
reanimated::NativeReanimatedModule::onRender(double)
reanimated::NativeReanimatedModule::maybeRequestRender()::$_6::operator()(double) const
decltype(std::__1::forward<reanimated::NativeReanimatedModule::maybeRequestRender()::$_6&>(fp)(std::__1::forward<double>(fp0))) std::__1::__invoke<reanimated::NativeReanimatedModule::maybeRequestRender()::$_6&, double>(reanimated::NativeReanimatedModule::maybeRequestRender()::$_6&, double&&)
void std::__1::__invoke_void_return_wrapper<void>::__call<reanimated::NativeReanimatedModule::maybeRequestRender()::$_6&, double>(reanimated::NativeReanimatedModule::maybeRequestRender()::$_6&, double&&)
std::__1::__function::__alloc_func<reanimated::NativeReanimatedModule::maybeRequestRender()::$_6, std::__1::allocator<reanimated::NativeReanimatedModule::maybeRequestRender()::$_6>, void (double)>::operator()(double&&)
std::__1::__function::__func<reanimated::NativeReanimatedModule::maybeRequestRender()::$_6, std::__1::allocator<reanimated::NativeReanimatedModule::maybeRequestRender()::$_6>, void (double)>::operator()(double&&)
std::__1::__function::__value_func<void (double)>::operator()(double&&) const
std::__1::function<void (double)>::operator()(double) const
invocation function for block in reanimated::createReanimatedModule(std::__1::shared_ptr<facebook::react::CallInvoker>)::$_0::operator()(std::__1::function<void (double)>, facebook::jsi::Runtime&) const
-[REANodesManager onAnimationFrame:]
CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long)
display_timer_callback(__CFMachPort*, void*, long, void*)
__CFMachPortPerform
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
__CFRunLoopDoSource1
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
-[UIApplication _run]
UIApplicationMain
main
start
0x0

Code

import React from 'react';
import {Dimensions, StyleSheet, View} from 'react-native';
import {
  ChartDot,
  ChartPath,
  ChartPathProvider,
  ChartXLabel,
  ChartYLabel,
  monotoneCubicInterpolation,
} from '@rainbow-me/animated-charts';

const {width: SIZE} = Dimensions.get('window');

const data = [
  {x: 1453075200, y: 1.47},
  {x: 1453161600, y: 1.37},
  {x: 1453248000, y: 1.53},
  {x: 1453334400, y: 1.54},
  {x: 1453420800, y: 1.52},
  {x: 1453507200, y: 2.03},
  {x: 1453593600, y: 2.1},
  {x: 1453680000, y: 2.5},
  {x: 1453766400, y: 2.3},
  {x: 1453852800, y: 2.42},
  {x: 1453939200, y: 2.55},
  {x: 1454025600, y: 2.41},
  {x: 1454112000, y: 2.43},
  {x: 1454198400, y: 2.2},
];

const points = monotoneCubicInterpolation({data, range: 40});

const getX = (value) => {
  'worklet';
  return `X - ${value}`;
};

const getY = (value) => {
  'worklet';
  return `Y - ${value}`;
};

const Invest = () => {
  return (
    <View style={styles.container}>
      <ChartPathProvider
        data={{
          points,
          // smoothingStrategy: 'bezier',
        }}>
        <ChartPath
          height={SIZE / 2}
          stroke={'blue'}
          width={SIZE}
          selectedStrokeWidth={3}
          strokeLinecap="round"
          strokeLinejoin="round"
          strokeWidth={3.5}
          hitSlop={30}
          longPressGestureHandlerProps={{
            minDurationMs: 60,
          }}
          smoothingWhileTransitioningEnabled={false}
        />
        <ChartDot style={styles.dot} />
        <ChartXLabel format={getX} />
        <ChartYLabel format={getY} />
      </ChartPathProvider>
    </View>
  );
};

export default Invest;

const styles = StyleSheet.create({
  container: {
    marginTop: 100,
    backgroundColor: 'white',
    flex: 1,
  },
  dot: {backgroundColor: 'blue'},
  center: {alignSelf: 'center'},
});

Repo Link

https://github.com/Kailash23/react-native-animated-chart-issue

Dependencies

"@rainbow-me/animated-charts": "^1.0.0-alpha.4",
"react": "16.13.1",
"react-native": "0.63.3",
"react-native-gesture-handler": "^1.9.0",
"react-native-reanimated": "^2.0.0-alpha.9.2", // Tried with this version also - 2.0.0-alpha.8
"react-native-svg": "^12.1.0"

Screenshot 2020-11-26 at 16 17 28

Unable to display X and Y value

Value is undefined, expected an Object

I copied the whole thing in your example and is not working. How can I fix it?

const data = [
    { x: 1453075200, y: 1.47 }, { x: 1453161600, y: 1.37 },
    { x: 1453248000, y: 1.53 }, { x: 1453334400, y: 1.54 },
    { x: 1453420800, y: 1.52 }, { x: 1453507200, y: 2.03 },
    { x: 1453593600, y: 2.10 }, { x: 1453680000, y: 2.50 },
    { x: 1453766400, y: 2.30 }, { x: 1453852800, y: 2.42 },
    { x: 1453939200, y: 2.55 }, { x: 1454025600, y: 2.41 },
    { x: 1454112000, y: 2.43 }, { x: 1454198400, y: 2.20 },
  ]

  const points = monotoneCubicInterpolation({ data, range: 40 })

  return (
    <ChartPathProvider data={{ points, smoothingStrategy: 'bezier' }}>
      <ChartPath height={150} stroke="yellow" width={SIZES.width} />
    </ChartPathProvider>
)

simulator_screenshot_EFDA435A-1912-4745-B33B-85DC51641A0F

Grid?

It looks really awesome. However, I really want a grid. Does it support it? Else, could you add it? Thanks!

Black background from example without main line path

Hi all,
I have the same issues as the person on github

https://stackoverflow.com/questions/68184815/rainbow-me-react-native-chart-not-showing-path

I've copied everything from the example, but don't see the line and tooltip, only black background
Of course, I have this line from example
const points = monotoneCubicInterpolation({ data, range: 40 })

console.log(points) => [], but why?
console.log(data) => array of objects with my data

Is there any solution?

I'm using

  • "expo": "^41.0.0",
  • "react-native-reanimated": "^2.1.0",
  • "@rainbow-me/animated-charts": "^1.0.0-alpha.6",

Blank black screen in android

The given example renders a blank black component in Android.

I am using the same code in example. However, with these updated library:
"react-native-svg": "^12.1.1",
"react-native-reanimated": "^2.1.0",
image

Can't properly format chart labels

I'm applying the following worklet:

const formatElevation = (value) => {
    'worklet';

    if (value === '') {
        return '';
    }

    const elevation = value.toLocaleString('en-US', {
        maximumFractionDigits: 2,
    });

    return `${elevation} ft`;
};

...to a ChartYLabel, but the decimal places are still extending beyond two places. The same thing happens when I try to apply currency formatting. Any idea what I'm doing wrong?

Wired splines representation when stable data

Hi @osdnk,

I'm doing some tests with stable data (without variation) and the graph looks weird:

image

The line dotted in purple is the path of react-native-animated-charts (I don't know why it does those splines), and on the other hand the chart in the background is the representation of victory charts using the same dataset.

Here I attach dataset and ChartPathProvider configuration, it would be very useful if you can help me @osdnk.

const data = [
  {
    "x": 0,
    "y": 138.35,
  },
  {
    "x": 1,
    "y": 138.35,
  },
  {
    "x": 2,
    "y": 138.35,
  },
  {
    "x": 3,
    "y": 138.35,
  },
  {
    "x": 4,
    "y": 138.35,
  },
  {
    "x": 5,
    "y": 138.35,
  },
  {
    "x": 6,
    "y": 138.35,
  },
];
const points = React.useMemo(
  () => ({
    points: interpolator({
      data,
      includeExtremes: true,
      range: 300, // ~1 year of working days
    }),
    smoothingStrategy: 'bezier',
  }),
  [data]
);
<ChartPathProvider data={points}>
  <ChartPath height={SIZE / 2} stroke="yellow" width={SIZE} />
</ChartPathProvider>

Thanks

Remove closed market \ gaps in x values

Hello there :)
First of all thank you very much for this amazing library your project looks awesome.

I'm having an issue using this library for an other kind of finance data, like stocks that has a time that the market is closed.
(unlike crypto currencies 😄 )

For example -
How the graph for a stock with closed market period should look like -

CustomChart

how it looks like with react-native-animated-charts (same raw data) -

WithCloseMarket

At the moment is there a way to prevent this behavior? I would really like to work with this lib for it amazing performance improvements over all other charts libraries.

I hope my issue is clear and feel free to ask me for more information
Thanks

Invalid data?

Why this data doesnt work?

[{"x": 0, "y": 678}, {"x": 21, "y": 779}, {"x": 37, "y": 888}, {"x": 64, "y": 989}, {"x": 93, "y": 1091}, {"x": 137, "y": 1203}, {"x": 155, "y": 1311}, {"x": 174, "y": 1433}, {"x": 196, "y": 1534}, {"x": 221, "y": 1641}, {"x": 242, "y": 1752}, {"x": 261, "y": 1857}]

later: interpolator({ elevationData, range: 80 });

It keeps returning empty arrays / errors.

Feature request for ChartXLabel overlay

Would be really cool to see a pattern like this added in a future release where you could optionally toggle the ChartXLabel to appear as an overlay on the chart itself. It's typically done at the top with a vertical line marking its current position (see the Apple Stock and Robinhood examples).

IMG_0728
IMG_0719

Error: If you want to use Reanimated 2 then go through our installation steps https://docs.swmansion.com/react-native-reanimated/docs/installation

ChartPathProvider when imported from @rainbow-me/animated-charts throwing an error

ERROR Error: If you want to use Reanimated 2 then go through our installation steps https://docs.swmansion.com/react-native-reanimated/docs/installation

This error is located at: in ChartPathProvider (at Chart.js:29)

I tried clearing cache and rebuilding still it failed.
Device - Android (Real Device)

[Web] TypeError: Cannot read property 'get' of undefined

It works on ios using expo, but when I go to get I get this error message.

image

Webpack config

const { createWebpackConfigAsync } = require('expo-yarn-workspaces/webpack');

module.exports = async function (env, argv) {
	const config = await createWebpackConfigAsync(
		{
			...env,
			babel: {
				dangerouslyAddModulePathsToTranspile: ['@ui-kitten/components', '@rainbow-me'],
			},
		},
		argv
	);
	return config;
};

Does this work with expo?

I currently have a managed expo application (expo 38) and was wondering if this library could be used without ejecting!

Add fallback for ChartLabel

It would be nice to still show a price when someone releases their finger. Right now, releasing your finger fully hides the price. It's a bit jarring. I notice the Rainbow example in the Readme doesn't hide the price when you release your finger. Is there a way to do the same in the lib?

It seems like this is caused by originalX.value = 0 when you stop animating, but I'm not totally sure.

Thanks!

Error Can't find variable: _setGlobalConsole when import

Hi,

I tried to create a new react-native project and when I try to import :
improt {ChartDot, ChartPath, ChartPathProvider, monotoneCubicInterpolation} from '@rainbow-me/animated-charts';

I get this error :
ReferenceError: Can't find variable: _setGlobalConsole
(node:24622) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 change listeners added to [HasteMap]. Use emitter.setMaxListeners() to increase limit

image

Is it an error you encountered before ?
I added the lastest react-native-reanimated and the babel plugin.

Thank you for any help :)

CurrentPositionVerticalLine Throwing Error

 <ChartPathProvider data={data}>

          <CurrentPositionVerticalLine />

          <ChartPath
            hapticsEnabled={hapticsEnabled}
            hitSlop={hitSlop}
            smoothingWhileTransitioningEnabled={
              smoothingWhileTransitioningEnabled
            }
            fill="none"
            height={SIZE / 2}
            stroke="red"
            strokeWidth="2"
            width={SIZE}
          />
          <ChartDot
            style={{
              backgroundColor: "red",
              marginTop: 20,
            }} />
          </ChartDot>
        </ChartPathProvider>

when removing CurrentPositionVerticalLine component, everything works well. However, when adding it, it throws error as the following:

Error shot

Example crashed at start up

When I run the Example app on ios or android emulator I get this error:

error: Error: Unable to resolve module `@babel/runtime/helpers/interopRequireDefault` from `../src/index.js`: @babel/runtime/helpers/interopRequireDefault could not be found within the project.

If you are sure the module exists, try these steps:
 1. Clear watchman watches: watchman watch-del-all
 2. Delete node_modules: rm -rf node_modules and run yarn install
 3. Reset Metro's cache: yarn start --reset-cache
 4. Remove the cache: rm -rf /tmp/metro-*
    at ModuleResolver.resolveDependency (/Users/danielmiranda/dev/libs/react-native-animated-charts/Example/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:186:15)
    at ResolutionRequest.resolveDependency (/Users/danielmiranda/dev/libs/react-native-animated-charts/Example/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:52:18)
    at DependencyGraph.resolveDependency (/Users/danielmiranda/dev/libs/react-native-animated-charts/Example/node_modules/metro/src/node-haste/DependencyGraph.js:287:16)
    at Object.resolve (/Users/danielmiranda/dev/libs/react-native-animated-charts/Example/node_modules/metro/src/lib/transformHelpers.js:267:42)
    at /Users/danielmiranda/dev/libs/react-native-animated-charts/Example/node_modules/metro/src/DeltaBundler/traverseDependencies.js:434:31
    at Array.map (<anonymous>)
    at resolveDependencies (/Users/danielmiranda/dev/libs/react-native-animated-charts/Example/node_modules/metro/src/DeltaBundler/traverseDependencies.js:431:18)
    at /Users/danielmiranda/dev/libs/react-native-animated-charts/Example/node_modules/metro/src/DeltaBundler/traverseDependencies.js:275:33
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/danielmiranda/dev/libs/react-native-animated-charts/Example/node_modules/metro/src/DeltaBundler/traverseDependencies.js:87:24)

I have tried the 4 steps on the message without luck:

  1. Clear watchman watches: watchman watch-del-all
  2. Delete node_modules: rm -rf node_modules and run yarn install
  3. Reset Metro's cache: yarn start --reset-cache
  4. Remove the cache: rm -rf /tmp/metro-*

I have also yarn add @babel/runtime but it does not seem to work.

Thanks for the time.

Chart tooltip

Hi! Can this library draw some kind of tooltip near the ChartDot? Or some kind of callback with the selected point data?

Chart disappears on second time navigating to screen

Hey all,

Pretty basic chart setup (see code below). Works great on first time navigating to screen, but if I pop back and then navigate to the screen again, the chart path disappears (dot still works though!) Using latest react-navigation if that helps.

Thanks!

<ChartPathProvider data={{ points: data }}>
    <ChartPath
        {...{ width }}
        fill='none'
        height={width / 2}
        stroke='black'
        strokeWidth={3.5}
        selectedStrokeWidth={3}
    />
    <ChartDot size={16} style={styles.chartDot} />
</ChartPathProvider>
RPReplay_Final1610045048.mov

Bad precision on interpolation

When making the calculations on the interpolator i'm getting numbers like 0.9999999999 making the graph change drastically when the numbers are equal when all Y is 1
image

[ {"x": 1610545770.339878, "y": 1}, {"x": 1610459370.352815, "y": 1}, {"x": 1610372970.354123, "y": 1}, {"x": 1610286570.355356, "y": 1}, {"x": 1610200170.356426, "y": 1}, {"x": 1610113770.357573, "y": 1}, {"x": 1610027370.358632, "y": 1}, {"x": 1609940970.359711, "y": 1} ]

Changes calculation

I am not going to report a bug but want to help developers whoever trying to calculate the changes and show along with dot location. To calculate changes you probably need current x and y location from useChartData() hook and that work would be cumbersome to get it done correctly. You need to use OriginalX and OriginalY and those values can be empty (for me they were).
There is a perfect workaround and works out of the box.
Just duplicate the ChartYLabel component, and make your calculation in the second one. Like below:

<ChartYLabel
        format={formatAmount} />
            
<ChartYLabel
        format={calculateChanges} />

So both methods will receive value as an input, so the in the first one just format the price amount and in the second one just calculate the changes with the value and the array that you provided for the chart. That simple!
Hope this helps someone : )

Is It Possible To Show nativePoints as a ChartPath When isActive is Triggered?

Hi! i really love this library, made some tweaks here and there in order to match user requirement, but right now i'm having difficulties,

is it possible to show our default points rather than interpolated one, when user are pressing the chart (isActive triggered)

Something like this,
Alt Text

by default it's still showing interpolated smoothen path, but when user are triggering the isActive (pressing the chart), i'd like to show the Default points data for more accurate representation (more jagged edges).

If you know, please advice :)

Thanks!!

Error while trying to use Chart

i get this error when i try to use the chart

null is not an object (evaluating '_ReanimatedModule.default.createNode)

please can anyone help

unable to see Dot on Screen

import React from 'react';
import {Dimensions, View} from 'react-native';
import {ChartDot, ChartPath, ChartPathProvider, monotoneCubicInterpolation} from '@rainbow-me/animated-charts';

export const {width: SIZE} = Dimensions.get('window');

export const data = [
{x: 1453075200, y: 1.47}, {x: 1453161600, y: 1.37},
{x: 1453248000, y: 1.53}, {x: 1453334400, y: 1.54},
{x: 1453420800, y: 1.52}, {x: 1453507200, y: 2.03},
{x: 1453593600, y: 2.10}, {x: 1453680000, y: 2.50},
{x: 1453766400, y: 2.30}, {x: 1453852800, y: 2.42},
{x: 1453939200, y: 2.55}, {x: 1454025600, y: 2.41},
{x: 1454112000, y: 2.43}, {x: 1454198400, y: 2.20},
];

const points = monotoneCubicInterpolation({data, range: 40});

const BasicExample = () => (
<View style={{ backgroundColor: 'black' }}>
<ChartPathProvider data={{ points, smoothingStrategy: 'bezier' }}>
<ChartPath height={SIZE / 2} stroke="yellow" width={SIZE} />
<ChartDot style={{ backgroundColor: 'blue' }} />


);

//unable to see Dot on a screen
Cant see Dot

Does this library work on android?

As I have seen this lib is extracted from Rainbow.me project which is an iOS app. I am confused whether this lib will works on android or not?

Symbol.iterator]() problem

after i install the repo in my project i found this error after trying to use chart :
TypeError: Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a Symbol.iterator method.
//import section import {ChartDot, ChartPath, ChartPathProvider} from '@rainbow-me/animated-charts'; //using view section <ChartPath height={SIZE / 2} stroke="yellow" width={SIZE} /> <ChartDot style={{ backgroundColor: 'blue' }} /> // My React native libs "@gorhom/bottom-sheet": "^3", "@rainbow-me/animated-charts": "^1.0.0-alpha.6", "expo": "~42.0.1", "expo-splash-screen": "~0.11.2", "expo-status-bar": "~1.0.4", "expo-updates": "~0.8.1", "react": "16.13.1", "react-dom": "16.13.1", "react-native": "~0.63.4", "react-native-gesture-handler": "^1.10.3", "react-native-reanimated": "^2.2.2", "react-native-screens": "~3.4.0", "react-native-svg": "^12.1.1", "react-native-unimodules": "0.14.10", "react-native-web": "~0.13.12"

chart dot doesn't move how drag it on the chart ?

import react from 'react';
import {dimensions, view} from 'react-native';
import {chartdot, chartpath, chartpathprovider, monotonecubicinterpolation} from '@rainbow-me/animated-charts';

export const {width: size} = dimensions.get('window');

export const data = [
{x: 1453075200, y: 1.47}, {x: 1453161600, y: 1.37},
{x: 1453248000, y: 1.53}, {x: 1453334400, y: 1.54},
{x: 1453420800, y: 1.52}, {x: 1453507200, y: 2.03},
{x: 1453593600, y: 2.10}, {x: 1453680000, y: 2.50},
{x: 1453766400, y: 2.30}, {x: 1453852800, y: 2.42},
{x: 1453939200, y: 2.55}, {x: 1454025600, y: 2.41},
{x: 1454112000, y: 2.43}, {x: 1454198400, y: 2.20},
];

const points = monotonecubicinterpolation(data)(40);

const Chart = () => (
<view style={{ backgroundcolor: 'black' }}>
<chartpathprovider data={{ points, smoothingstrategy: 'bezier' }}>
<chartpath height={size / 2} stroke="yellow" width={size} />
<chartdot style={{ backgroundcolor: 'blue' }} />


)
export default Chart

error Failed to install the app. Make sure you have the Android development environment set up:

Hi,

I built & start run-andoird this Example project.

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
Note: ~/react-native-animated-charts/Example/node_modules/@react-native-community/viewpager/android/src/main/java/com/reactnativecommunity/viewpager/ReactViewPagerManager.java uses or overrides a deprecated API.
info Run CLI with --verbose flag for more details.

Why occur this issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.