How do you use highcharts-rounded-corners as an npm module? - highcharts

Does anyone know how to actually use the highcharts-rounded-corners npm module? The only examples in the repo use <script> tags on the page rather than the npm module, and the npm module itself has no examples.
Just importing the module doesn't work; treating it as a wrapper and passing the Highcharts module to it doesn't either... ?

To add a module, import and initialize it:
import Highcharts from "highcharts/highstock";
import HighchartsReact from "highcharts-react-official";
import HC_rounded from "highcharts-rounded-corners";
// init the module
HC_rounded(Highcharts);
Official doc on how to use Highchart modules:
https://github.com/highcharts/highcharts-react#how-to-add-a-module
Demo:
https://stackblitz.com/edit/react-wjzbhd?file=index.js

Related

how to install model_evaluation_utils

I'm trying to model evaluate the performance of our deep learning models. And below is my code. However, I still get
No module named 'model_evaluation_utils'
Is there any pip installation or conda that could solve this problem?
from keras.preprocessing.image import load_img, img_to_array, array_to_img
from keras.models import load_model
import model_evaluation_utils as meu # throws error
Implementation of "model_evaluation_utils" can be found in the following github repository:
link
I think it's not a publicly available library, there must be a model_evaluation_utils.py file which is imported in the code and is used.

when using exporting(highchart) in angular 7 got the the error

using exporting(highchart) getting below error:
ERROR in src/app/desktop/module/dashboard/dashboard.module.ts(24,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'typeof import("C:/website/UI_Dashboard/node_modules/highchart
s/modules/exporting.src")' has no compatible call signatures.
in the module:
import {ChartModule, HIGHCHARTS_MODULES} from 'angular-highcharts';
import * as more from 'highcharts/highcharts-more.src';
import * as highcharts from 'highcharts';
import * as exporting from 'highcharts/modules/exporting.src';
import * as offline from 'highcharts/modules/offline-exporting';
exporting(highcharts);
offline(highcharts);
what should I do for solving this issue?
Have you tried with import exporting from 'highcharts/modules/exporting.src';?
It's the suggested way of module working as documented in the official Highcharts wrapper for Angular - https://github.com/highcharts/highcharts-angular#core
You should also load all Highcharts related files as src or minified - mixing might cause some TS issues.
An import path for src version of Highcharts core is 'highcharts/highcharts.src'.
Also (I'm not sure if this applies here since the code might not be complete), highcharts-more needs to be initialized as any other module. Usually it is loaded before other modules - initialization order is rarely important (some series types are based on optional modules) and you will get an error if the order is wrong, so it's important to test this.
In case anyone encounters this problem nowadays, changing this:
import * as exporting from 'highcharts/modules/exporting.src';
To this:
import Exporting from 'highcharts/modules/exporting';
Solved the problem for me.
I'm using Angular CLI 11.1.4 and the Highcharts npm package v9.2.2

Putting AngularDart components in subfolders when routing

According to this tutorial, when defining routes in Angular for Dart you need to import the template.dart files of the relevant components:
import 'crisis_list_component.template.dart' as clct;
import 'hero_list_component.template.dart' as hlct;
I have put my components in a subfolder of the folder where this code resides. I have the import code in lib/src/routes.dart:
import 'components/foobar/foobar_component.template.dart' as fct;
and a Foobar component in lib/src/components/foobar/foorbar_component.dart.
When I have the foobar_component.dart code in src (i.e. the same folder as routes.dart) there's no problem. But when I move it to its own subfolder, I get the error:
Unable to find modules for some sources [...] Please check the following imports: import 'components/foobar/foobar_component.template.dart'
How do I get it to find the component in its subfolder?
You could use
import '../../components/foobar/foobar_component.template.dart' as fct;
but usually, it is better to not use ../ in imports and instead use package imports
import 'package:my_package/web/src/components/foobar/foobar_component.template.dart' as fct;
where my_package is the string used in name: ... in your pubspec.yaml and lib/ is skipped in the path to the imported file.

Could not load lang::java::jdt::Java

When trying to import JAVA modules I receive an error:
// JAVA imports
import lang::java::jdt::Java;
import lang::java::jdt::JDT;
import lang::java::jdt::JavaADT;
Could not load lang::java::jdt::Java
In the console:
rascal>import lang::java::jdt::Java;
|prompt:///|(0,29,<1,0>,<1,29>): Could not import module lang::java::jdt::Java: can not find in search path
Advice: |http://tutor.rascal-mpl.org/Errors/Static/ModuleImport/ModuleImport.html|
I'm using Eclipse and am trying to use the AstNode datatype. Any ideas?
The JDT modules have been replaced a while back by the m3 model.
While they are a bit different, the AST part should be comparable.
Check the m3 ast documentation and the Measuring java recipe.
Is this an old project you are trying to get up and running?

Top level routines of one library are inaccessible when loaded through another library in Dart

Say, I load this script in the browser:
<script src='app.dart' type='application/dart'></script>
Now, in app.dart I have this:
import 'library1.dart';
unleashTheKraken();
Then in library1.dart you'll find this:
library library1;
import 'library2';
And finally in library2.dart we'll have:
library library2;
unleashTheKraken() => print('Unleashing the Kraken')
And the result is: Exception: No top-level method 'unleashTheKraken' declared. How so?
Because imports don't chain automatically. You have to use the export statement for that.
library library1;
import "library2.dart";
export "library2.dart";
And to avoid unnecessary code: import and export are completely independent. If you don't use unleashTheKraken in library1 itself, you can omit the import statement and just use export alone.

Resources