point chart fixes

dev
RekHoto 2 years ago
parent e40af1b5d3
commit 966339138d

@ -67,6 +67,24 @@ export const PointChart = ({ point }) => {
plugins: {
legend: {
display: false
},
tooltip: {
displayColors: false,
callbacks: {
label: function(context) {
const label = []
const shap_key = Object.keys(GRAPH_LABELS_MAP).find(key => GRAPH_LABELS_MAP[key] === context.label);
const key = shap_key.substring(0, shap_key.length - 5)
label.push("Значение: \n" + point[key]);
if (context.parsed.x !== null) {
label.push("Вклад в прогноз, %: " + context.parsed.x);
}
return label;
},
body: () => {
return "Вклад в прогноз, %:"
}
}
}
},
scales: {
@ -78,11 +96,12 @@ export const PointChart = ({ point }) => {
}
}
};
const labels = Object.keys(GRAPH_LABELS_MAP).sort((a, b) => {
if (Math.abs(point[a]) < Math.abs(point[b])) return 1;
else return -1;
}).slice(0, 15);
labels.map((l) => console.log(l, point[l]))
const data = {
labels: labels.map((l) => GRAPH_LABELS_MAP[l]),
datasets: [

@ -1,6 +1,6 @@
export const PanoramaIcon = ({ width = 24, height = 24 }) => {
return (
<svg xmlns="http://www.w3.org/2000/svg" className="rounded-md bg-[#cc2222] p-1" width={width} height={height} viewBox="0 0 24 24">
<svg xmlns="http://www.w3.org/2000/svg" className="rounded-md bg-[#cc2222] hover:bg-[#d94c48] p-1" width={width} height={height} viewBox="0 0 24 24">
<path
fillRule="evenodd"
clipRule="evenodd"

@ -41,9 +41,7 @@ export const TableSettings = ({orderColumns}) => {
<div className="flex flex-col" {...provided.droppableProps} ref={provided.innerRef}>
{columnsList.map((item, index) => {
const num = item.position;
console.log(num, item);
if (!orderColumns.defaultColumns[num]) return;
console.log(num, item);
return (
<Draggable key={`list-${num}`} draggableId={`list-${num}`} index={index}>
{(provided) => (

@ -7,6 +7,7 @@ import { AddressSearch } from "../../Map/AddressSearch.jsx";
import { SearchOutlined } from "@ant-design/icons";
import { useTable } from "../../stores/useTable.js";
import useLocalStorage from "../../hooks/useLocalStorage.js";
import { TrafficModal } from "../../Map/TrafficModal.jsx";
export const useColumns = (fields = [], key) => {
const { data: regions } = useGetRegions();
const {
@ -103,6 +104,7 @@ export const useColumns = (fields = [], key) => {
ellipsis: true,
sorter: true,
showSorterTooltip: false,
render: (_, record) => <TrafficModal point={record} />
},
{
title: "Кол-во подъездов в жилом доме",

Loading…
Cancel
Save