Diego F Medina
Diego F Medina

Reputation: 499

How to avoid AG Grid theme selection overwriting the Voila theme

I have a voila that displays an AG Grid, as soon as the table is created the Voila theme is changed. See below minimal reproducible example: I use am using voila's "dark" theme, once the table is created the voila theme changes to "light":

{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from time import sleep\n",
    "from ipyaggrid import Grid\n",
    "print('Theme is dark now')\n",
    "sleep(10)\n",
    "Grid(grid_data=[{'Foo': 'spam', 'Bar': 'eggs'}], grid_options={'columnDefs': [{'field': 'Foo'}, {'field': 'Bar'}]})\n",
    "print('Theme is light now')"
   ]
  }
 ],
 "metadata": {
  "jupytext": {
   "formats": "ipynb,py:light",
   "text_representation": {
    "extension": ".py",
    "format_name": "light",
    "format_version": "1.4",
    "jupytext_version": "1.2.0"
   }
  },
  "kernelspec": {
   "display_name": "Python 3.8.10 ('env_local')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  },
  "voila": {
   "theme": "dark"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}


voila == 0.4.0

ipyaggrid == 0.4.0

Upvotes: 0

Views: 75

Answers (0)

Related Questions