FlexiScore Editor is a React tool for building credit scoring decisions.
It’s a fork of the open-source JDM Editor and lets you visually create decision flows — like eligibility checks, scorecards, adjustments, risk grades, and final decisions all in one place.
By using a clear visual interface with JSON underneath, it makes building, understanding, and updating credit rules much easier for developers and analysts.
git clone https://github.com/jkatumba/flexiscore-editor.git
cd flexiscore-editorrun:
pnpm installThis will install all dependencies listed in the package.json.
pnpm run buildThis will create a compiled version of the library in the dist/ folder, ready to use in your project.
From your project root, run:
pnpm add ../flexiscore-editorpnpm run dev...
import '@gorules/jdm-editor/dist/style.css';
import { DecisionGraph, JdmConfigProvider } from '@gorules/jdm-editor';
...
<JdmConfigProvider>
<DecisionGraph
value={graph}
onChange={(val) => setGraph(val as any)}
/>
</JdmConfigProvider>Here’s a simplified, easy-to-understand guide for developers on how to use your FlexiScore Editor library, without all the verbose details from your full example:
- Import the components
"use client";
import dynamic from "next/dynamic";
import "@gorules/jdm-editor/dist/style.css"; // styles
// Dynamically import core components
const DecisionGraph = dynamic(() => import("flexiscore-editor").then(mod => mod.DecisionGraph), { ssr: false });
const JdmConfigProvider = dynamic(() => import("flexiscore-editor").then(mod => mod.JdmConfigProvider), { ssr: false });
const GraphSimulator = dynamic(() => import("flexiscore-editor").then(mod => mod.GraphSimulator), { ssr: false });- Set up a graph state
import { useState } from "react";
const emptyGraph = { nodes: [], edges: [] };
const [graph, setGraph] = useState(emptyGraph);- Handle graph changes
const handleGraphChange = (newGraph) => {
setGraph(newGraph);
localStorage.setItem("flexiscore-graph", JSON.stringify(newGraph));
};- Add simulation panel
const panels = [
{
id: "simulator",
title: "Simulator",
renderPanel: () => <GraphSimulator defaultRequest={`{ "input": 15 }`} onRun={yourSimulationHandler} />,
},
];- Render the editor
<JdmConfigProvider>
<DecisionGraph
value={graph}
onChange={handleGraphChange}
panels={panels}
/>
</JdmConfigProvider>DecisionGraph= main editorJdmConfigProvider= context/config wrapperGraphSimulator= optional simulation panel- The
graphstate stores your nodes and edges as JSON (JDM) - You can save/load the graph from
localStorageor backend
MIT © GoRules