Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

I am getting error Invalid argument data[0].pathOffset passed into DataTable with ID "canvaas-table". Expected one of type [string, number, boolean]. #67

Description

@muntakim1

Hello,

error Invalid argument `data[0].pathOffset` passed into DataTable with ID "canvaas-table". Expected one of type [string, number, boolean].

While running the code:

fromdashimportDash, html, dash_table, Input, Output, callbackfromdash.exceptionsimportPreventUpdatefromdash_canvasimportDashCanvasimportjsonapp=Dash(__name__)
filename='https://raw.githubusercontent.com/plotly/datasets/master/mitochondria.jpg'canvas_width=500columns= ['type', 'width', 'height', 'scaleX', 'strokeWidth', 'path']
app.layout=html.Div([
html.H6('Draw on image and press Save to show annotations geometry'),
DashCanvas(id='annot-canvas',
lineWidth=5,
filename=filename,
width=canvas_width,
),
dash_table.DataTable(id='canvaas-table',
style_cell={'textAlign': 'left'},
columns=[{"name": i, "id": i} foriincolumns]),
])
@callback(Output('canvaas-table', 'data'),Input('annot-canvas', 'json_data'))defupdate_data(string):
ifstring:
data=json.loads(string)
else:
raisePreventUpdatereturndata['objects'][1:]
if__name__=='__main__':
app.run(debug=True)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions