Error while running simulator #200
Unanswered
aayushbhaglal
asked this question in
Q&A
Replies: 1 comment
-
@ivanmiletic can you please help with this |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
This is my App.js file. I am not getting any response from GraphSimulator component on running simulator. I am also attaching my input graph json file.
input simulator json:
`{
loan: {
applicantAge: 70,
tenure: 24,
cibil: 660,
pincode: 521001,
},
}
graph25.json
`
`import './App.css';
import React, { useRef, useState } from 'react';
import '@gorules/jdm-editor/dist/style.css';
import { DecisionGraph, JdmConfigProvider, GraphSimulator, GraphNode, createJdmNode } from '@gorules/jdm-editor';
import { ApartmentOutlined, ApiOutlined, LeftOutlined, PlayCircleOutlined, RightOutlined } from '@ant-design/icons';
import { Select } from 'antd';
import json5 from 'json5';
function App() {
const [value, setValue] = useState();
const ref = useRef(null);
const panels = [
{
id: 'simulator',
title: 'Simulator',
icon: ,
renderPanel: () => (
<GraphSimulator
defaultRequest={json5.stringify(
{
age: 20,
},
null,
2,
)}
onChange={(val) => {
console.log(val);
}}
onRun={(payload) => {
setValue(payload.graph);
}}
onClear={() => {}}
/>
),
},
];
return (
<div style={{ height: '100%' }}>
<DecisionGraph
ref={ref}
value={value}
onChange={(val) => setValue(val)}
panels={panels}
defaultActivePanel={'simulator'}
onPanelsChange={(val) => {
console.log(val);
}}
/>
);
}
export default App;`
Thanks
Beta Was this translation helpful? Give feedback.
All reactions