-
Notifications
You must be signed in to change notification settings - Fork 80
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
Formatter function dependencies not included #79
Comments
The problem here is that we use webview and we inject the javascript there. When you declare a variable in the app, the reference does not exist. Im thinking how it should work, because the webview is really limited. |
@sebastianbochan Yes, this is definitely why it is happening. The only solutions I see is to declare all the variables within the formatter function body or inject all dependencies in the web view, although both solutions sound suboptimal. Do you have any suggestions? Thanks |
Do you mean to add variables + values from RN to webview by injectJavascript? It sounds really strange, especially that RN variables can change, but communication between layers is limited. Correct me if Im wrong. |
@sebastianbochan For example I have a system wide value formatting engine, I already use to format values and input on RN side, and I would like to use same engine in chart formatters functions. The only way I found so far is to copy over and inject the entire engine with all dependencies in the web view. |
@VitaliiK91, |
It feels like the issue resides in this line: https://github.com/highcharts/highcharts-react-native/blob/master/dist/src/HighchartsReactNative.js#L98 I'm very confused as to why passing a string works but passing an object doesn't. I've tried several options – see @sebastianbochan's reference to my issue above. |
@VitaliiK91 ping ping. Can you help this keep moving forward? |
any solution? |
Is there a way to be able to access the Chart Object in these functions? |
When function passed to formatter calls other functions (i.e. lodash or any other library) or functions defined outside of the scope of formatter function, it throws
Can't find variable
exception. This seems to be due to outer functions or libraries don't make it to the WebView where charts are rendered. How can we bypass it?Example of not working formatter funtion:
will throw
Can't find variable sum
The text was updated successfully, but these errors were encountered: