@malloydata/render 0.0.61-dev230724154311 → 0.0.61-dev230724171210
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/html/number.js +2 -5
- package/dist/html/table.js +11 -0
- package/package.json +3 -3
package/dist/html/number.js
CHANGED
|
@@ -21,15 +21,12 @@
|
|
|
21
21
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
22
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
-
};
|
|
27
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
25
|
exports.NumberRendererFactory = exports.HTMLNumberRenderer = void 0;
|
|
29
26
|
const malloy_1 = require("@malloydata/malloy");
|
|
30
27
|
const text_1 = require("./text");
|
|
31
28
|
const renderer_factory_1 = require("../renderer_factory");
|
|
32
|
-
const
|
|
29
|
+
const ssf_1 = require("ssf");
|
|
33
30
|
class HTMLNumberRenderer extends text_1.HTMLTextRenderer {
|
|
34
31
|
constructor(document, options) {
|
|
35
32
|
super(document);
|
|
@@ -41,7 +38,7 @@ class HTMLNumberRenderer extends text_1.HTMLTextRenderer {
|
|
|
41
38
|
}
|
|
42
39
|
if (this.options.value_format) {
|
|
43
40
|
try {
|
|
44
|
-
return
|
|
41
|
+
return (0, ssf_1.format)(this.options.value_format, data.number.value);
|
|
45
42
|
}
|
|
46
43
|
catch {
|
|
47
44
|
// TODO: explore surfacing invalid format error, ignoring it for now.
|
package/dist/html/table.js
CHANGED
|
@@ -119,6 +119,17 @@ class HTMLTableRenderer extends container_1.ContainerRenderer {
|
|
|
119
119
|
if ((aValue === null || aValue === void 0 ? void 0 : aValue.isScalar()) &&
|
|
120
120
|
(bValue === null || bValue === void 0 ? void 0 : bValue.isScalar()) &&
|
|
121
121
|
typeof aValue === typeof bValue) {
|
|
122
|
+
if (aValue.isNull()) {
|
|
123
|
+
if (bValue.isNull()) {
|
|
124
|
+
return 0;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
return 1;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
else if (bValue.isNull()) {
|
|
131
|
+
return -1;
|
|
132
|
+
}
|
|
122
133
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
123
134
|
const compValue = aValue.compareTo(bValue);
|
|
124
135
|
if (compValue !== 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloydata/render",
|
|
3
|
-
"version": "0.0.61-
|
|
3
|
+
"version": "0.0.61-dev230724171210",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"prepublishOnly": "npm run build"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@malloydata/malloy": "^0.0.61-
|
|
21
|
+
"@malloydata/malloy": "^0.0.61-dev230724171210",
|
|
22
22
|
"@types/luxon": "^2.4.0",
|
|
23
23
|
"lodash": "^4.17.20",
|
|
24
24
|
"luxon": "^2.4.0",
|
|
25
|
-
"
|
|
25
|
+
"ssf": "^0.11.2",
|
|
26
26
|
"us-atlas": "^3.0.0",
|
|
27
27
|
"vega": "^5.21.0",
|
|
28
28
|
"vega-lite": "^5.2.0"
|