{
  "meta": {
    "version": "4.000.9103",
    "fileFormatVersion": "0.4",
    "date": "2024-12-02T22:07:04.068Z",
    "name": "iris-tutorial",
    "description": "",
    "groupName": "",
    "tags": [
      {
        "text": "Tutorial"
      },
      {
        "text": "pyodide"
      }
    ],
    "schedulerLogOff": true
  },
  "data": {
    "datanodes": [
      {
        "name": "classifier",
        "type": "Python_plugin",
        "settings": {
          "name": "classifier",
          "autoStart": true,
          "explicitTrig": false,
          "content": "from sklearn.ensemble import RandomForestClassifier\nclf=RandomForestClassifier()\nclf.fit(dataNodes[\"dataset\"].data,dataNodes[\"dataset\"].target)\nreturn clf\n",
          "dockerImage": {
            "name": "Pyodide",
            "id": "__PYODIDE__"
          }
        }
      },
      {
        "name": "dataset",
        "type": "Python_plugin",
        "settings": {
          "name": "dataset",
          "autoStart": true,
          "explicitTrig": false,
          "content": "from sklearn import datasets\niris=datasets.load_iris()\nreturn chalkit.as_python(iris)",
          "dockerImage": {
            "name": "Pyodide",
            "id": "__PYODIDE__"
          }
        }
      },
      {
        "name": "datasetDataframe",
        "type": "Python_plugin",
        "settings": {
          "name": "datasetDataframe",
          "autoStart": true,
          "explicitTrig": false,
          "content": "import pandas as pd\n\niris=dataNodes[\"dataset\"]\n\ndf = pd.DataFrame(data=iris.data, columns=iris.feature_names)\ndf[\"target\"] = iris.target\ntarget_names = {0: \"Setosa\", 1: \"Versicolour\", 2:\"Virginica\" }\ndf['target'] =df['target'].map(target_names)\n\nreturn chalkit.as_python(df)",
          "dockerImage": {
            "name": "Pyodide",
            "id": "__PYODIDE__"
          }
        }
      },
      {
        "name": "inputs",
        "type": "JSON_var_plugin",
        "settings": {
          "name": "inputs",
          "json_var": "{\"sepal_width\":4.8,\"sepal_length\":2.3,\"petal_length\":3.7,\"petal_width\":2.1}"
        }
      },
      {
        "name": "plot",
        "type": "Python_plugin",
        "settings": {
          "name": "plot",
          "autoStart": true,
          "explicitTrig": false,
          "content": "import plotly.express as px\n\ndf = dataNodes[\"datasetDataframe\"]\nfig = px.scatter(df, x=\"sepal width (cm)\", y=\"sepal length (cm)\", color=\"target\", size='petal length (cm)', hover_data=['petal width (cm)'])\n\nreturn fig\n\n",
          "dockerImage": {
            "name": "Pyodide",
            "id": "__PYODIDE__"
          }
        }
      },
      {
        "name": "predict",
        "type": "Python_plugin",
        "settings": {
          "name": "predict",
          "autoStart": true,
          "explicitTrig": false,
          "content": "import pandas as pd\nfrom sklearn.ensemble import RandomForestClassifier\n\ndf =pd.DataFrame(dataNodes[\"inputs\"],index=[0])\nclf = dataNodes[\"classifier\"]\n\nprediction=clf.predict(df)\n\nreturn dataNodes[\"dataset\"].target_names[prediction][0]",
          "dockerImage": {
            "name": "Pyodide",
            "id": "__PYODIDE__"
          }
        }
      }
    ]
  },
  "libraries": {
    "pyodideStandard": [
      "numpy",
      "pandas",
      "scikit-learn"
    ],
    "pyodideMicropip": [
      "plotly"
    ]
  },
  "dashboard": {
    "plotlyGeneric0": {
      "layout": {
        "top": 0,
        "left": 6,
        "height": 399,
        "width": 549,
        "z-index": "1"
      },
      "container": {
        "instanceId": "plotlyGeneric0",
        "modelJsonId": "plotlyGeneric"
      },
      "modelParameters": {
        "enforceTextColor": true,
        "textColor": "var(--widget-color)",
        "enforceBackgroundTransparency": true,
        "hideModeBar": false,
        "showWidget": true,
        "enableWidget": true
      },
      "modelHiddenParams": {
        "data": [
          {
            "type": "bar",
            "x": [],
            "y": []
          }
        ],
        "layout": {
          "paper_bgcolor": "rgba(0,0,0,0)",
          "plot_bgcolor": "rgba(0,0,0,0)",
          "template": {
            "layout": {
              "xaxis": {
                "gridcolor": "var(--widget-plotly-background-color)"
              },
              "yaxis": {
                "gridcolor": "var(--widget-plotly-background-color)"
              },
              "zaxis": {
                "gridcolor": "var(--widget-plotly-background-color)"
              },
              "colorway": [
                "var(--widget-color-2)",
                "var(--widget-color-5)",
                "var(--widget-color-6)",
                "var(--widget-color-7)",
                "var(--widget-color-8)",
                "var(--widget-color-9)",
                "var(--widget-color-10)",
                "var(--widget-color-11)",
                "var(--widget-color-12)",
                "var(--widget-color-13)"
              ],
              "font": {
                "color": "var(--widget-color)"
              }
            }
          }
        },
        "selection": [
          {}
        ]
      }
    },
    "flatUiHorizontalSliderA": {
      "layout": {
        "top": 70,
        "left": 601,
        "height": 38,
        "width": 367,
        "z-index": "7"
      },
      "container": {
        "instanceId": "flatUiHorizontalSliderA",
        "modelJsonId": "flatUiHorizontalSlider"
      },
      "modelParameters": {
        "label": "sepal_width",
        "inheritLabelFromData": true,
        "displayLabel": true,
        "labelFontSize": 0.5,
        "labelColor": "var(--widget-label-color)",
        "labelFontFamily": "var(--widget-font-family)",
        "rangeActuator": false,
        "min": 4.3,
        "max": 7.9,
        "step": 0.1,
        "displayValue": true,
        "validationOnFocusOut": true,
        "valueFontSize": 0.5,
        "valueFontFamily": "var(--widget-font-family)",
        "valueBorderColor": "var(--widget-border-color)",
        "labelWidthProportion": "20%",
        "sliderWidthProportion": "60%",
        "valueWidthProportion": "20%",
        "sliderRangeColor": "var(--widget-range-color)",
        "sliderSegmentColor": "var(--widget-segment-color)",
        "sliderHandleDefaultColor": "var(--widget-handle-default-color)",
        "sliderHandleHoverColor": "var(--widget-handle-hover-color)",
        "sliderHandleActiveColor": "var(--widget-handle-active-color)",
        "valueColor": "var(--widget-color)",
        "unit": "unitText",
        "displayUnit": false,
        "unitFontSize": 0.5,
        "showWidget": true,
        "enableWidget": true
      },
      "modelHiddenParams": {
        "value": 0
      }
    },
    "flatUiHorizontalSliderB": {
      "layout": {
        "top": 112,
        "left": 601,
        "height": 38,
        "width": 367,
        "z-index": "8"
      },
      "container": {
        "instanceId": "flatUiHorizontalSliderB",
        "modelJsonId": "flatUiHorizontalSlider"
      },
      "modelParameters": {
        "label": "sepal_length",
        "inheritLabelFromData": true,
        "displayLabel": true,
        "labelFontSize": 0.5,
        "labelColor": "var(--widget-label-color)",
        "labelFontFamily": "var(--widget-font-family)",
        "rangeActuator": false,
        "min": 2,
        "max": 4.4,
        "step": 0.1,
        "displayValue": true,
        "validationOnFocusOut": true,
        "valueFontSize": 0.5,
        "valueFontFamily": "var(--widget-font-family)",
        "valueBorderColor": "var(--widget-border-color)",
        "labelWidthProportion": "20%",
        "sliderWidthProportion": "60%",
        "valueWidthProportion": "20%",
        "sliderRangeColor": "var(--widget-range-color)",
        "sliderSegmentColor": "var(--widget-segment-color)",
        "sliderHandleDefaultColor": "var(--widget-handle-default-color)",
        "sliderHandleHoverColor": "var(--widget-handle-hover-color)",
        "sliderHandleActiveColor": "var(--widget-handle-active-color)",
        "valueColor": "var(--widget-color)",
        "unit": "unitText",
        "displayUnit": false,
        "unitFontSize": 0.5,
        "showWidget": true,
        "enableWidget": true
      },
      "modelHiddenParams": {
        "value": 0
      }
    },
    "flatUiHorizontalSliderC": {
      "layout": {
        "top": 155,
        "left": 601,
        "height": 38,
        "width": 367,
        "z-index": "9"
      },
      "container": {
        "instanceId": "flatUiHorizontalSliderC",
        "modelJsonId": "flatUiHorizontalSlider"
      },
      "modelParameters": {
        "label": "petal_length",
        "inheritLabelFromData": true,
        "displayLabel": true,
        "labelFontSize": 0.5,
        "labelColor": "var(--widget-label-color)",
        "labelFontFamily": "var(--widget-font-family)",
        "rangeActuator": false,
        "min": 1,
        "max": 6.9,
        "step": 0.1,
        "displayValue": true,
        "validationOnFocusOut": true,
        "valueFontSize": 0.5,
        "valueFontFamily": "var(--widget-font-family)",
        "valueBorderColor": "var(--widget-border-color)",
        "labelWidthProportion": "20%",
        "sliderWidthProportion": "60%",
        "valueWidthProportion": "20%",
        "sliderRangeColor": "var(--widget-range-color)",
        "sliderSegmentColor": "var(--widget-segment-color)",
        "sliderHandleDefaultColor": "var(--widget-handle-default-color)",
        "sliderHandleHoverColor": "var(--widget-handle-hover-color)",
        "sliderHandleActiveColor": "var(--widget-handle-active-color)",
        "valueColor": "var(--widget-color)",
        "unit": "unitText",
        "displayUnit": false,
        "unitFontSize": 0.5,
        "showWidget": true,
        "enableWidget": true
      },
      "modelHiddenParams": {
        "value": 0
      }
    },
    "flatUiHorizontalSliderD": {
      "layout": {
        "top": 196,
        "left": 601,
        "height": 38,
        "width": 367,
        "z-index": "10"
      },
      "container": {
        "instanceId": "flatUiHorizontalSliderD",
        "modelJsonId": "flatUiHorizontalSlider"
      },
      "modelParameters": {
        "label": "petal_width",
        "inheritLabelFromData": true,
        "displayLabel": true,
        "labelFontSize": 0.5,
        "labelColor": "var(--widget-label-color)",
        "labelFontFamily": "var(--widget-font-family)",
        "rangeActuator": false,
        "min": 0.1,
        "max": 2.5,
        "step": 0.1,
        "displayValue": true,
        "validationOnFocusOut": true,
        "valueFontSize": 0.5,
        "valueFontFamily": "var(--widget-font-family)",
        "valueBorderColor": "var(--widget-border-color)",
        "labelWidthProportion": "20%",
        "sliderWidthProportion": "60%",
        "valueWidthProportion": "20%",
        "sliderRangeColor": "var(--widget-range-color)",
        "sliderSegmentColor": "var(--widget-segment-color)",
        "sliderHandleDefaultColor": "var(--widget-handle-default-color)",
        "sliderHandleHoverColor": "var(--widget-handle-hover-color)",
        "sliderHandleActiveColor": "var(--widget-handle-active-color)",
        "valueColor": "var(--widget-color)",
        "unit": "unitText",
        "displayUnit": false,
        "unitFontSize": 0.5,
        "showWidget": true,
        "enableWidget": true
      },
      "modelHiddenParams": {
        "value": 0
      }
    },
    "kpiCardA": {
      "layout": {
        "top": 84,
        "left": 1001,
        "height": 120,
        "width": 275,
        "z-index": "11"
      },
      "container": {
        "instanceId": "kpiCardA",
        "modelJsonId": "kpiCard"
      },
      "modelParameters": {
        "label": "predict",
        "inheritLabelFromData": true,
        "displayLabel": true,
        "labelFontSize": 0.5,
        "labelColor": "var(--widget-label-color)",
        "labelFontFamily": "var(--widget-font-family)",
        "valuePosition": "bottom",
        "valueFontSize": 2,
        "valueColor": "var(--widget-color)",
        "valueFontFamily": "var(--widget-font-family)",
        "decimalDigits": 3,
        "unit": "unitText",
        "displayUnit": false,
        "unitFontSize": 0.5,
        "unitColor": "var(--widget-label-color)",
        "borderShadow": false,
        "showWidget": true,
        "enableWidget": true
      },
      "modelHiddenParams": {
        "value": "--"
      }
    }
  },
  "connections": {
    "plotlyGeneric0": {
      "data": {
        "name": "data",
        "dataNode": "plot",
        "dataFields": [
          "data"
        ],
        "dataNodeIndex": 5
      },
      "layout": {
        "name": "layout",
        "dataNode": "plot",
        "dataFields": [
          "layout"
        ],
        "dataNodeIndex": 5
      }
    },
    "flatUiHorizontalSliderA": {
      "value": {
        "name": "value",
        "dataNode": "inputs",
        "dataFields": [
          "sepal_width"
        ]
      }
    },
    "flatUiHorizontalSliderB": {
      "value": {
        "name": "value",
        "dataNode": "inputs",
        "dataFields": [
          "sepal_length"
        ]
      }
    },
    "flatUiHorizontalSliderC": {
      "value": {
        "name": "value",
        "dataNode": "inputs",
        "dataFields": [
          "petal_length"
        ]
      }
    },
    "flatUiHorizontalSliderD": {
      "value": {
        "name": "value",
        "dataNode": "inputs",
        "dataFields": [
          "petal_width"
        ]
      }
    },
    "kpiCardA": {
      "value": {
        "name": "value",
        "dataNode": "predict",
        "dataFields": []
      }
    }
  },
  "display": {
    "theme": "default",
    "backgroundColor": "var(--widget-color-0)",
    "inheritThemeBackgroundColor": true,
    "marginX": 10,
    "marginY": 10,
    "width": 1294,
    "height": 590,
    "enforceHeightLimit": false
  },
  "navBarNotification": false
}