diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f84668..09f87a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to shinywidgets will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [UNRELEASED] - 2025-01-23 + +* Fixed an issue with plotly graphs sometimes not getting fully removed from the DOM. (#178) + ## [0.4.2] - 2024-12-18 * Fixed an issue where `@render_widget` would sometimes incorrectly render a new widget without removing the old one. (#167) diff --git a/js/src/output.ts b/js/src/output.ts index 8c803c7..1383eb1 100644 --- a/js/src/output.ts +++ b/js/src/output.ts @@ -227,6 +227,8 @@ Shiny.addCustomMessageHandler("shinywidgets_comm_close", async (msg_txt) => { // way to drop the resize event listener (see the diff in the link above) // https://github.com/posit-dev/py-shinywidgets/issues/166 delete v.model; + // Ensure sure the lm-Widget container is also removed + v.remove(); } diff --git a/shinywidgets/__init__.py b/shinywidgets/__init__.py index 7bc562a..eaaae4f 100644 --- a/shinywidgets/__init__.py +++ b/shinywidgets/__init__.py @@ -2,7 +2,7 @@ __author__ = """Carson Sievert""" __email__ = "carson@posit.co" -__version__ = "0.4.2" +__version__ = "0.4.2.9000" from ._as_widget import as_widget from ._dependencies import bokeh_dependency diff --git a/shinywidgets/static/output.js b/shinywidgets/static/output.js index 4c4fec7..db65d40 100644 --- a/shinywidgets/static/output.js +++ b/shinywidgets/static/output.js @@ -36,7 +36,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \***********************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _jupyter_widgets_html_manager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyter-widgets/html-manager */ \"@jupyter-widgets/html-manager\");\n/* harmony import */ var _jupyter_widgets_html_manager__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyter_widgets_html_manager__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _comm__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./comm */ \"./src/comm.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ \"./src/utils.ts\");\nvar _a;\n\n\n\n/******************************************************************************\n * Define a custom HTMLManager for use with Shiny\n ******************************************************************************/\nclass OutputManager extends _jupyter_widgets_html_manager__WEBPACK_IMPORTED_MODULE_0__.HTMLManager {\n // In a soon-to-be-released version of @jupyter-widgets/html-manager,\n // display_view()'s first \"dummy\" argument will be removed... this shim simply\n // makes it so that our manager can work with either version\n // https://github.com/jupyter-widgets/ipywidgets/commit/159bbe4#diff-45c126b24c3c43d2cee5313364805c025e911c4721d45ff8a68356a215bfb6c8R42-R43\n async display_view(view, options) {\n const n_args = super.display_view.length;\n if (n_args === 3) {\n return super.display_view({}, view, options);\n }\n else {\n // @ts-ignore\n return super.display_view(view, options);\n }\n }\n}\n// Define our own custom module loader for Shiny\nconst shinyRequireLoader = async function (moduleName, moduleVersion) {\n // shiny provides require.js and also sets `define.amd=false` to prevent