Browse Source

[Minor] Format numbers with d3.format,

remove Humanize JS library.
tags/2.3
moisseev 4 years ago
parent
commit
e621411215
4 changed files with 11 additions and 16 deletions
  1. 5
    5
      interface/js/app/history.js
  2. 6
    4
      interface/js/app/stats.js
  3. 0
    6
      interface/js/lib/humanize.min.js
  4. 0
    1
      interface/js/main.js

+ 5
- 5
interface/js/app/history.js View File

@@ -22,10 +22,10 @@
THE SOFTWARE.
*/

/* global FooTable:false */
/* global d3:false FooTable:false */

define(["jquery", "footable", "humanize"],
function ($, _, Humanize) {
define(["jquery", "footable"],
function ($) {
"use strict";
var ui = {};
var prevVersion = null;
@@ -157,7 +157,7 @@ define(["jquery", "footable", "humanize"],
"font-size": "11px",
"minwidth": 50,
},
formatter: Humanize.compactInteger
formatter: d3.format(".3~s")
}, {
name: "time_real",
title: "Scan time",
@@ -245,7 +245,7 @@ define(["jquery", "footable", "humanize"],
"width": 120,
"maxWidth": 120
},
formatter: Humanize.compactInteger
formatter: d3.format(".3~s")
}, {
name: "scan_time",
title: "Scan time",

+ 6
- 4
interface/js/app/stats.js View File

@@ -22,8 +22,10 @@
THE SOFTWARE.
*/

define(["jquery", "d3pie", "humanize"],
function ($, d3pie, Humanize) {
/* global d3:false */

define(["jquery", "d3pie"],
function ($) {
"use strict";
// @ ms to date
function msToTime(seconds) {
@@ -77,9 +79,9 @@ define(["jquery", "d3pie", "humanize"],
"</strong>" + i + "</div>";
$(widget).appendTo(widgets);
} else {
var titleAtt = Humanize.intComma(item) + " " + i;
var titleAtt = d3.format(",")(item) + " " + i;
widget = "<li class=\"stat-box\"><div class=\"widget\" title=\"" + titleAtt + "\"><strong>" +
Humanize.compactInteger(item) + "</strong>" + i + "</div></li>";
d3.format(".3~s")(item) + "</strong>" + i + "</div></li>";
if (i === "scanned") {
stat_w[0] = widget;
} else if (i === "clean") {

+ 0
- 6
interface/js/lib/humanize.min.js
File diff suppressed because it is too large
View File


+ 0
- 1
interface/js/main.js View File

@@ -6,7 +6,6 @@ requirejs.config({
app: "../app",
jquery: "jquery-3.4.1.min",
visibility: "visibility.min",
humanize: "humanize.min",
bootstrap: "bootstrap.min",
d3: "d3.min",
d3evolution: "d3evolution.min",

Loading…
Cancel
Save