export d3.format as format
This commit is contained in:
parent
7b9df92ee7
commit
090f3d2d37
|
@ -10,7 +10,7 @@
|
|||
#'
|
||||
#' @return a \code{JS} function
|
||||
#' @export
|
||||
#'
|
||||
#'
|
||||
#' @importFrom htmlwidgets JS
|
||||
#'
|
||||
#' @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 = "")
|
||||
}
|
||||
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
|
||||
))
|
||||
}
|
||||
|
|
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 "../css/apexcharter.css";
|
||||
|
||||
/*
|
||||
window.d3 = {
|
||||
format: format,
|
||||
formatLocale: formatLocale
|
||||
};
|
||||
*/
|
||||
//window['d3.format'] = format;
|
||||
//window['d3.formatLocale'] = formatLocale;
|
||||
// add in webpackconfig: output.libraryTarget: 'window'
|
||||
export { format , formatLocale };
|
||||
|
||||
|
||||
HTMLWidgets.widget({
|
||||
name: "apexcharter",
|
||||
|
|
|
@ -61,6 +61,7 @@ var options = {
|
|||
output: {
|
||||
filename: '[name].js',
|
||||
path: path.resolve(__dirname, JSON.parse(outputPath)),
|
||||
libraryTarget: 'window'
|
||||
},
|
||||
externals: externals,
|
||||
module: {
|
||||
|
|
Loading…
Reference in New Issue