Files
redash/viz-lib/src/visualizations/visualizationsSettings.tsx
Tsuneo Yoshioka d8ae679937 Make NULL values visible (#7439)
* Make NULL value visible
* Make the representation of NULL value configurable
* use display-as-null css class for null-value styling
2025-07-16 00:48:36 +00:00

56 lines
1.3 KiB
TypeScript

import React from "react";
import { extend } from "lodash";
import Tooltip from "antd/lib/tooltip";
type HelpTriggerProps = {
title?: React.ReactNode;
href: string;
className?: string;
children?: React.ReactNode;
};
function HelpTrigger({ title, href, className, children }: HelpTriggerProps) {
return (
<Tooltip
title={
<React.Fragment>
{title}
<i className="fa fa-external-link" style={{ marginLeft: 5 }} />
</React.Fragment>
}>
<a className={className} href={href} target="_blank" rel="noopener noreferrer">
{children}
</a>
</Tooltip>
);
}
HelpTrigger.defaultValues = {
title: null,
className: null,
children: null,
};
function Link(props: any) {
return <a {...props} />;
}
export const visualizationsSettings = {
HelpTriggerComponent: HelpTrigger,
LinkComponent: Link,
dateFormat: "DD/MM/YYYY",
dateTimeFormat: "DD/MM/YYYY HH:mm",
integerFormat: "0,0",
floatFormat: "0,0.00",
nullValue: "null",
booleanValues: ["false", "true"],
tableCellMaxJSONSize: 50000,
allowCustomJSVisualizations: false,
hidePlotlyModeBar: false,
choroplethAvailableMaps: {},
};
export function updateVisualizationsSettings(options: any) {
extend(visualizationsSettings, options);
}