diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7cd907e..eabfaa4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-yaml - id: end-of-file-fixer @@ -10,14 +10,14 @@ repos: - repo: https://github.com/astral-sh/uv-pre-commit # uv version. - rev: "0.6.10" + rev: "0.9.4" hooks: # Update the uv lockfile - id: uv-lock - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.11.2 + rev: v0.14.1 hooks: # Run the linter. - id: ruff @@ -26,7 +26,7 @@ repos: - id: ruff-format - repo: https://github.com/pycqa/flake8 - rev: 7.1.2 # pick a git hash / tag to point to + rev: 7.3.0 # pick a git hash / tag to point to hooks: - id: flake8 args: ["--config=.flake8"] diff --git a/pyproject.toml b/pyproject.toml index 89ac744..336c57a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "funcnodes-plotly" -version = "1.0.0" +version = "1.1.0" description = "" readme = "README.md" classifiers = [ @@ -12,9 +12,8 @@ dependencies = [ "funcnodes_pandas>=0.2.3", "funcnodes_core>=0.3.51", "funcnodes_images", - "plotly>=6.0.0", - "kaleido==0.1.0post1; sys_platform == 'win32'", - "kaleido==0.2.1; sys_platform != 'win32' and sys_platform != 'emscripten'", + "plotly[kaleido]>=6.0.0", + ] requires-python = ">=3.11" [[project.authors]] @@ -28,6 +27,8 @@ dev = [ "pytest", "pre-commit", "funcnodes-module", + "funcnodes-pandas", + "funcnodes-files", ] [build-system] @@ -54,7 +55,7 @@ tag_format = "v$version" version_scheme = "pep440" version_provider = "uv" update_changelog_on_bump = true + [project.entry-points."funcnodes.module"] module = "funcnodes_plotly" shelf = "funcnodes_plotly:NODE_SHELF" - diff --git a/src/funcnodes_plotly/__init__.py b/src/funcnodes_plotly/__init__.py index e72452f..1b8d8f5 100644 --- a/src/funcnodes_plotly/__init__.py +++ b/src/funcnodes_plotly/__init__.py @@ -85,8 +85,15 @@ def figure_byte_encoder(figure: go.Figure, preview) -> fn.BytesEncdata: REACT_PLUGIN = { "module": os.path.join(os.path.dirname(__file__), "react_plugin", "index.iife.js"), - "css": [os.path.join(os.path.dirname(__file__), "react_plugin", "plugin-custom-renders.css")], + "css": [ + os.path.join( + os.path.dirname(__file__), "react_plugin", "plugin-custom-renders.css" + ) + ], + "js": [ + os.path.join(os.path.dirname(__file__), "react_plugin", "plotly-3.1.0.min.js") + ], } -__version__ = "1.0.0" +__version__ = "1.1.0" diff --git a/src/funcnodes_plotly/react_plugin/index.iife.js b/src/funcnodes_plotly/react_plugin/index.iife.js index 2e3d98e..058d5d7 100644 --- a/src/funcnodes_plotly/react_plugin/index.iife.js +++ b/src/funcnodes_plotly/react_plugin/index.iife.js @@ -1,4 +1,4 @@ -var FuncNodesPlugin=function(cb,fb){"use strict";function uS(zl){const mu=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(zl){for(const Oc in zl)if(Oc!=="default"){const Es=Object.getOwnPropertyDescriptor(zl,Oc);Object.defineProperty(mu,Oc,Es.get?Es:{enumerable:!0,get:()=>zl[Oc]})}}return mu.default=zl,Object.freeze(mu)}const Wh=uS(cb);function cS(zl){return zl&&zl.__esModule&&Object.prototype.hasOwnProperty.call(zl,"default")?zl.default:zl}var Zy={exports:{}},C0={};/** +var FuncNodesPlugin=function(g,w){"use strict";function j(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const c=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,c.get?c:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const s=j(g);var R={exports:{}},f={};/** * @license React * react-jsx-runtime.production.js * @@ -6,3861 +6,4 @@ var FuncNodesPlugin=function(cb,fb){"use strict";function uS(zl){const mu=Object * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var hb;function fS(){if(hb)return C0;hb=1;var zl=Symbol.for("react.transitional.element"),mu=Symbol.for("react.fragment");function Oc(Es,Ul,Bc){var Bf=null;if(Bc!==void 0&&(Bf=""+Bc),Ul.key!==void 0&&(Bf=""+Ul.key),"key"in Ul){Bc={};for(var Rh in Ul)Rh!=="key"&&(Bc[Rh]=Ul[Rh])}else Bc=Ul;return Ul=Bc.ref,{$$typeof:zl,type:Es,key:Bf,ref:Ul!==void 0?Ul:null,props:Bc}}return C0.Fragment=mu,C0.jsx=Oc,C0.jsxs=Oc,C0}var vb;function hS(){return vb||(vb=1,Zy.exports=fS()),Zy.exports}var Eh=hS(),Yy={},$y={},Ky={exports:{}},Jy,db;function vS(){if(db)return Jy;db=1;var zl="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Jy=zl,Jy}var Qy,pb;function dS(){if(pb)return Qy;pb=1;var zl=vS();function mu(){}function Oc(){}return Oc.resetWarningCache=mu,Qy=function(){function Es(Bf,Rh,Fv,nd,ev,Ov){if(Ov!==zl){var tv=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw tv.name="Invariant Violation",tv}}Es.isRequired=Es;function Ul(){return Es}var Bc={array:Es,bigint:Es,bool:Es,func:Es,number:Es,object:Es,string:Es,symbol:Es,any:Es,arrayOf:Ul,element:Es,elementType:Es,instanceOf:Ul,node:Es,objectOf:Ul,oneOf:Ul,oneOfType:Ul,shape:Ul,exact:Ul,checkPropTypes:Oc,resetWarningCache:mu};return Bc.PropTypes=Bc,Bc},Qy}var gb;function pS(){return gb||(gb=1,Ky.exports=dS()()),Ky.exports}var mb;function gS(){return mb||(mb=1,function(zl){function mu(ps){"@babel/helpers - typeof";return mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ol){return typeof ol}:function(ol){return ol&&typeof Symbol=="function"&&ol.constructor===Symbol&&ol!==Symbol.prototype?"symbol":typeof ol},mu(ps)}Object.defineProperty(zl,"__esModule",{value:!0}),zl.default=Bv;var Oc=Bf(cb),Es=Ul(pS());function Ul(ps){return ps&&ps.__esModule?ps:{default:ps}}function Bc(ps){if(typeof WeakMap!="function")return null;var ol=new WeakMap,yi=new WeakMap;return(Bc=function(gf){return gf?yi:ol})(ps)}function Bf(ps,ol){if(ps&&ps.__esModule)return ps;if(ps===null||mu(ps)!=="object"&&typeof ps!="function")return{default:ps};var yi=Bc(ol);if(yi&&yi.has(ps))return yi.get(ps);var Cc={},gf=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var sc in ps)if(sc!=="default"&&Object.prototype.hasOwnProperty.call(ps,sc)){var Eo=gf?Object.getOwnPropertyDescriptor(ps,sc):null;Eo&&(Eo.get||Eo.set)?Object.defineProperty(Cc,sc,Eo):Cc[sc]=ps[sc]}return Cc.default=ps,yi&&yi.set(ps,Cc),Cc}function Rh(ps,ol){if(!(ps instanceof ol))throw new TypeError("Cannot call a class as a function")}function Fv(ps,ol){for(var yi=0;yi
P[0])return!0}return!1}function S(O){var P=O._fullLayout,N=P._size,U=N.p,X=o.list(O,"",!0),te,ue,ie,le,q,J;if(P._paperdiv.style({width:O._context.responsive&&P.autosize&&!O._context._hasZeroWidth&&!O.layout.width?"100%":P.width+"px",height:O._context.responsive&&P.autosize&&!O._context._hasZeroHeight&&!O.layout.height?"100%":P.height+"px"}).selectAll(".main-svg").call(r.setSize,P.width,P.height),O._context.setBackground(O,P.paper_bgcolor),Y.drawMainTitle(O),a.manage(O),!P._has("cartesian"))return x.previousPromises(O);function ee(Oe,de,me){var be=Oe._lw/2;if(Oe._id.charAt(0)==="x"){if(de){if(me==="top")return de._offset-U-be}else return N.t+N.h*(1-(Oe.position||0))+be%1;return de._offset+de._length+U+be}if(de){if(me==="right")return de._offset+de._length+U+be}else return N.l+N.w*(Oe.position||0)+be%1;return de._offset-U-be}for(te=0;te