export d3.format as format
This commit is contained in:
parent
7b9df92ee7
commit
090f3d2d37
|
@ -10,7 +10,7 @@
|
||||||
#'
|
#'
|
||||||
#' @return a \code{JS} function
|
#' @return a \code{JS} function
|
||||||
#' @export
|
#' @export
|
||||||
#'
|
#'
|
||||||
#' @importFrom htmlwidgets JS
|
#' @importFrom htmlwidgets JS
|
||||||
#'
|
#'
|
||||||
#' @example examples/format.R
|
#' @example examples/format.R
|
||||||
|
@ -21,7 +21,7 @@ format_num <- function(format, prefix = "", suffix = "", locale = "en-US") {
|
||||||
locale <- paste(readLines(con = path, encoding = "UTF-8"), collapse = "")
|
locale <- paste(readLines(con = path, encoding = "UTF-8"), collapse = "")
|
||||||
}
|
}
|
||||||
JS(sprintf(
|
JS(sprintf(
|
||||||
"function(value) {var locale = d3.formatLocale(JSON.parse('%s')); return '%s' + locale.format('%s')(value) + '%s';}",
|
"function(value) {var locale = formatLocale(JSON.parse('%s')); return '%s' + locale.format('%s')(value) + '%s';}",
|
||||||
locale, prefix, format, suffix
|
locale, prefix, format, suffix
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,12 +4,11 @@ import {format, formatLocale} from "d3-format";
|
||||||
import * as utils from "../modules/utils";
|
import * as utils from "../modules/utils";
|
||||||
import "../css/apexcharter.css";
|
import "../css/apexcharter.css";
|
||||||
|
|
||||||
/*
|
//window['d3.format'] = format;
|
||||||
window.d3 = {
|
//window['d3.formatLocale'] = formatLocale;
|
||||||
format: format,
|
// add in webpackconfig: output.libraryTarget: 'window'
|
||||||
formatLocale: formatLocale
|
export { format , formatLocale };
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
HTMLWidgets.widget({
|
HTMLWidgets.widget({
|
||||||
name: "apexcharter",
|
name: "apexcharter",
|
||||||
|
|
|
@ -61,6 +61,7 @@ var options = {
|
||||||
output: {
|
output: {
|
||||||
filename: '[name].js',
|
filename: '[name].js',
|
||||||
path: path.resolve(__dirname, JSON.parse(outputPath)),
|
path: path.resolve(__dirname, JSON.parse(outputPath)),
|
||||||
|
libraryTarget: 'window'
|
||||||
},
|
},
|
||||||
externals: externals,
|
externals: externals,
|
||||||
module: {
|
module: {
|
||||||
|
|
Loading…
Reference in New Issue