I'm trying to implement the Metrics Graphics library into the (custom coded) WordPress site. By instructions from the library's readme, I installed the module using Yarn, and tried to import it with the following code:
import LineChart from './metrics-graphics';
var data = [{'date': new Date('2014-10-01'), 'value': 100}, {'date': new Date('2014-11-01'), 'value': 200}, {'date': new Date('2014-12-01'), 'value': 300}];
data_graphic({
target: '.timeseries-graph-wrapper',
data: data,
title: "Dummy timeseries graph",
description: 'This is dummy timeseries graph',
x_accessor: 'date',
y_accessor: 'value'
});
But, after script execution I get this error message:
Loading module from “https://localhost/new.biznob.com/wp-content/plugins/market-data/js/metrics-graphics/” was blocked because of a disallowed MIME type (“text/html”)
What should I do to properly import the library?