Skip to content

Commit

Permalink
Merge branch 'main' into fix-build
Browse files Browse the repository at this point in the history
  • Loading branch information
vthemelis committed Feb 23, 2023
2 parents 1d8fb98 + 8482383 commit 700e726
Show file tree
Hide file tree
Showing 9 changed files with 436 additions and 243 deletions.
2 changes: 1 addition & 1 deletion ipydatagrid/_version.py
@@ -1,4 +1,4 @@
# Copyright (c) Bloomberg.
# Distributed under the terms of the Modified BSD License.

__version__ = "1.1.14"
__version__ = "1.1.15"
22 changes: 19 additions & 3 deletions ipydatagrid/cellrenderer.py
Expand Up @@ -6,7 +6,17 @@
from bqplot import ColorScale, Scale
from ipywidgets import Color, Widget, widget_serialization
from py2vega import Variable, py2vega
from traitlets import Any, Bool, Enum, Float, Instance, Unicode, Union, validate
from traitlets import (
Any,
Bool,
Enum,
Float,
Instance,
Unicode,
Union,
default,
validate,
)

from ._frontend import module_name, module_version

Expand Down Expand Up @@ -68,11 +78,9 @@ class TextRenderer(CellRenderer):
).tag(sync=True, **widget_serialization)
text_color = Union(
(Color(), Instance(VegaExpr), Instance(ColorScale)),
default_value=Expr("default_value"),
).tag(sync=True, **widget_serialization)
background_color = Union(
(Color(), Instance(VegaExpr), Instance(ColorScale)),
default_value=Expr("default_value"),
).tag(sync=True, **widget_serialization)
vertical_alignment = Union(
(
Expand All @@ -98,6 +106,14 @@ class TextRenderer(CellRenderer):
)
missing = Unicode("").tag(sync=True)

@default("text_color")
def _default_text_color(self):
return Expr("default_value")

@default("background_color")
def _default_background_color(self):
return Expr("default_value")


class BarRenderer(TextRenderer):
_model_name = Unicode("BarRendererModel").tag(sync=True)
Expand Down
13 changes: 8 additions & 5 deletions js/datagrid.ts
Expand Up @@ -18,8 +18,9 @@ import {
DOMWidgetView,
ICallbacks,
ISerializers,
// @ts-ignore needed for ipywidgetx 8.x compatibility
JupyterLuminoPanelWidget,
//@ts-ignore needed for ipywidgetx 7.x compatibility
// @ts-ignore needed for ipywidgetx 7.x compatibility
JupyterPhosphorPanelWidget,
resolvePromisesDict,
unpack_models,
Expand Down Expand Up @@ -348,7 +349,7 @@ export class DataGridView extends DOMWidgetView {
return this.luminoWidget.node;
}

// Added for ipywidgets 7.x compatibility
// @ts-ignore Added for ipywidgets 7.x compatibility
get pWidget(): any {
return this.luminoWidget;
}
Expand All @@ -371,7 +372,7 @@ export class DataGridView extends DOMWidgetView {
// ipywidgets 7 compatibility
_processLuminoMessage(
msg: Message,
_super: DOMWidgetView['processLuminoMessage'],
_super: any,
): void {
_super.call(this, msg);

Expand All @@ -385,11 +386,12 @@ export class DataGridView extends DOMWidgetView {
}

processLuminoMessage(msg: Message): void {
// @ts-ignore needed for ipywidgets 8.x compatibility
this._processLuminoMessage(msg, super.processLuminoMessage);
}

processPhosphorMessage(msg: Message): void {
//@ts-ignore needed for ipywidgets 7.x compatibility
// @ts-ignore needed for ipywidgets 7.x compatibility
this._processLuminoMessage(msg, super.processPhosphorMessage);
}

Expand Down Expand Up @@ -722,6 +724,7 @@ export class DataGridView extends DOMWidgetView {
default_renderer: CellRendererView;
header_renderer: CellRendererView;
grid: FeatherGrid;
// @ts-ignore needed for ipywidgetx 8.x compatibility
luminoWidget: JupyterLuminoPanelWidget;
model: DataGridModel;
backboneModel: DataGridModel;
Expand Down Expand Up @@ -766,7 +769,7 @@ export namespace DataGridModel {
*/
namespace Private {
export function getWidgetPanel(): any {
//@ts-ignore needed for ipywidget 7.x compatibility
// @ts-ignore needed for ipywidget 7.x compatibility
return JupyterLuminoPanelWidget ?? JupyterPhosphorPanelWidget;
}

Expand Down
41 changes: 38 additions & 3 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "ipydatagrid",
"version": "1.1.14",
"version": "1.1.15",
"description": "Fast Datagrid widget for the Jupyter Notebook and JupyterLab",
"keywords": [
"jupyter",
Expand Down Expand Up @@ -65,7 +65,7 @@
"@lumino/messaging": "^1.9.0",
"@lumino/virtualdom": "^1.13.0",
"@lumino/widgets": "^1.28.0",
"bqplot": "^0.4.6",
"bqplot": "^0.5",
"d3-array": "^2.2.0",
"d3-color": "^3.1.0",
"d3-format": "^1.3.2",
Expand All @@ -82,7 +82,6 @@
"@babel/preset-env": "^7.6.3",
"@babel/preset-typescript": "^7.6.0",
"@jupyterlab/builder": "^3.0.1",
"@lumino/application": "^1.6.0",
"@types/jest": "^27.4.1",
"@types/node": "^10.11.6",
"@types/webpack-env": "^1.13.6",
Expand Down Expand Up @@ -120,6 +119,42 @@
"@jupyter-widgets/base": {
"bundled": false,
"singleton": true
},
"@lumino/algorithm": {
"bundled": false,
"singleton": true
},
"@lumino/commands": {
"bundled": false,
"singleton": true
},
"@lumino/coreutils": {
"bundled": false,
"singleton": true
},
"@lumino/datagrid": {
"bundled": false,
"singleton": true
},
"@lumino/default-theme": {
"bundled": false,
"singleton": true
},
"@lumino/domutils": {
"bundled": false,
"singleton": true
},
"@lumino/messaging": {
"bundled": false,
"singleton": true
},
"@lumino/virtualdom": {
"bundled": false,
"singleton": true
},
"@lumino/widgets": {
"bundled": false,
"singleton": true
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Expand Up @@ -37,7 +37,7 @@ dependencies = [
"pandas",
"py2vega>=0.5.0",
]
version = "1.1.14"
version = "1.1.15"

[project.license]
file = "LICENSE.txt"
Expand Down Expand Up @@ -124,7 +124,7 @@ field = [
]

[tool.tbump.version]
current = "1.1.14"
current = "1.1.15"
regex = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)((?P<channel>a|b|rc|.dev)(?P<release>\\d+))?"

[tool.tbump.git]
Expand Down
2 changes: 1 addition & 1 deletion style/feathergrid.css
Expand Up @@ -56,7 +56,7 @@
font-size: var(--ipydatagrid-ui-font-size1);
}

.p-DataGrid {
.ipydatagrid-widget > div {
width: 100%;
height: 100%;
padding: var(--ipydatagrid-padding);
Expand Down
40 changes: 19 additions & 21 deletions ui-tests-ipw7/yarn.lock
Expand Up @@ -2310,13 +2310,13 @@ get-caller-file@^2.0.5:
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==

get-intrinsic@^1.0.2:
version "1.1.1"
resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6"
integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==
version "1.2.0"
resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.0.tgz#7ad1dc0535f3a2904bba075772763e5051f6d05f"
integrity sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==
dependencies:
function-bind "^1.1.1"
has "^1.0.3"
has-symbols "^1.0.1"
has-symbols "^1.0.3"

get-stream@^5.1.0:
version "5.2.0"
Expand Down Expand Up @@ -2367,6 +2367,11 @@ has-symbols@^1.0.1, has-symbols@^1.0.2:
resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423"
integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==

has-symbols@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8"
integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==

has-tostringtag@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25"
Expand Down Expand Up @@ -2640,11 +2645,9 @@ json-stringify-pretty-compact@~3.0.0:
integrity sha512-Rc2suX5meI0S3bfdZuA7JMFBGkJ875ApfVyq2WHELjBiiG22My/l7/8zPpH/CfFVQHuVLd8NLR0nv6vi0BYYKA==

json5@^2.1.1, json5@^2.1.2:
version "2.2.0"
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3"
integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==
dependencies:
minimist "^1.2.5"
version "2.2.3"
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283"
integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==

jsonfile@^6.0.1:
version "6.1.0"
Expand Down Expand Up @@ -2820,16 +2823,11 @@ minimatch@^3.0.3, minimatch@^3.0.4:
dependencies:
brace-expansion "^1.1.7"

minimist@^1.2.0:
minimist@^1.2.0, minimist@^1.2.5, minimist@~1.2.0:
version "1.2.7"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18"
integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==

minimist@^1.2.5, minimist@~1.2.0:
version "1.2.6"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44"
integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==

mkdirp@^0.5.5:
version "0.5.5"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
Expand Down Expand Up @@ -2900,9 +2898,9 @@ object-assign@^4.1.1:
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=

object-inspect@^1.9.0:
version "1.11.0"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1"
integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==
version "1.12.3"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9"
integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==

object-is@^1.0.1:
version "1.1.5"
Expand Down Expand Up @@ -3141,9 +3139,9 @@ punycode@^2.1.0:
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==

qs@^6.4.0:
version "6.10.1"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.1.tgz#4931482fa8d647a5aab799c5271d2133b981fb6a"
integrity sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==
version "6.11.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a"
integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==
dependencies:
side-channel "^1.0.4"

Expand Down
15 changes: 4 additions & 11 deletions ui-tests-ipw8/yarn.lock
Expand Up @@ -2640,11 +2640,9 @@ json-stringify-pretty-compact@~3.0.0:
integrity sha512-Rc2suX5meI0S3bfdZuA7JMFBGkJ875ApfVyq2WHELjBiiG22My/l7/8zPpH/CfFVQHuVLd8NLR0nv6vi0BYYKA==

json5@^2.1.1, json5@^2.1.2:
version "2.2.0"
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3"
integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==
dependencies:
minimist "^1.2.5"
version "2.2.3"
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283"
integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==

jsonfile@^6.0.1:
version "6.1.0"
Expand Down Expand Up @@ -2820,16 +2818,11 @@ minimatch@^3.0.3, minimatch@^3.0.4:
dependencies:
brace-expansion "^1.1.7"

minimist@^1.2.0:
minimist@^1.2.0, minimist@^1.2.5, minimist@~1.2.0:
version "1.2.7"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18"
integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==

minimist@^1.2.5, minimist@~1.2.0:
version "1.2.6"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44"
integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==

mkdirp@^0.5.5:
version "0.5.5"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
Expand Down

0 comments on commit 700e726

Please sign in to comment.