updated PyPi version

This commit is contained in:
root 2021-08-07 00:58:31 +00:00
parent 8968bab35f
commit 48a964a653
8 changed files with 21 additions and 11 deletions

View File

@ -22,9 +22,13 @@ class DataframeInput extends BaseComponent {
let column = {};
if (this.props.datatype) {
let datatype =
typeof this.props.datatype === "string"
? this.props.datatype
: this.props.datatype[i];
this.props.datatype instanceof Array
? this.props.datatype[i]
: this.props.datatype;
let col_width =
this.props.col_width instanceof Array
? this.props.col_width[i]
: this.props.col_width;
let datatype_map = {
str: "text",
bool: "checkbox",
@ -32,6 +36,7 @@ class DataframeInput extends BaseComponent {
date: "calendar"
};
column.type = datatype_map[datatype];
column.width = col_width;
}
if (this.props.headers) {
column.title = this.props.headers[i];

View File

@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: gradio
Version: 2.2.7
Version: 2.2.8
Summary: Python library for easily interacting with trained machine learning models
Home-page: https://github.com/gradio-app/gradio-UI
Author: Abubakar Abid

View File

@ -36,6 +36,8 @@ gradio/frontend/static/css/main.1c7a53e3.css
gradio/frontend/static/css/main.1c7a53e3.css.map
gradio/frontend/static/css/main.2ed025e4.css
gradio/frontend/static/css/main.2ed025e4.css.map
gradio/frontend/static/css/main.b74df5ce.css
gradio/frontend/static/css/main.b74df5ce.css.map
gradio/frontend/static/media/logo.411acfd1.svg
gradio/frontend/static/media/logo_loading.e93acd82.jpg
test/test_demos.py

View File

@ -1,18 +1,18 @@
{
"files": {
"main.css": "/static/css/main.1c7a53e3.css",
"main.css": "/static/css/main.b74df5ce.css",
"main.js": "/static/bundle.js",
"main.js.map": "/static/bundle.js.map",
"index.html": "/index.html",
"static/bundle.css.map": "/static/bundle.css.map",
"static/bundle.js.LICENSE.txt": "/static/bundle.js.LICENSE.txt",
"static/css/main.1c7a53e3.css.map": "/static/css/main.1c7a53e3.css.map",
"static/css/main.b74df5ce.css.map": "/static/css/main.b74df5ce.css.map",
"static/media/logo.411acfd1.svg": "/static/media/logo.411acfd1.svg",
"static/media/logo_loading.e93acd82.jpg": "/static/media/logo_loading.e93acd82.jpg"
},
"entrypoints": [
"static/bundle.css",
"static/css/main.1c7a53e3.css",
"static/css/main.b74df5ce.css",
"static/bundle.js"
]
}

View File

@ -8,4 +8,4 @@
window.config = {{ config|tojson }};
} catch (e) {
window.config = {};
}</script><script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.contentWindow.min.js"></script><title>Gradio</title><link href="static/bundle.css" rel="stylesheet"><link href="static/css/main.1c7a53e3.css" rel="stylesheet"></head><body style="height:100%"><div id="root" style="height:100%"></div><script src="static/bundle.js"></script></body></html>
}</script><script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.contentWindow.min.js"></script><title>Gradio</title><link href="static/bundle.css" rel="stylesheet"><link href="static/css/main.b74df5ce.css" rel="stylesheet"></head><body style="height:100%"><div id="root" style="height:100%"></div><script src="static/bundle.js"></script></body></html>

View File

@ -1086,13 +1086,14 @@ class Dataframe(InputComponent):
Input type: Union[pandas.DataFrame, numpy.array, List[Union[str, float]], List[List[Union[str, float]]]]
"""
def __init__(self, headers=None, row_count=3, col_count=3, datatype="str", default=None, type="pandas", label=None):
def __init__(self, headers=None, row_count=3, col_count=3, datatype="str", col_width=None, default=None, type="pandas", label=None):
"""
Parameters:
headers (List[str]): Header names to dataframe.
row_count (int): Limit number of rows for input.
col_count (int): Limit number of columns for input. If equal to 1, return data will be one-dimensional. Ignored if `headers` is provided.
datatype (Union[str, List[str]]): Datatype of values in sheet. Can be provided per column as a list of strings, or for the entire sheet as a single string. Valid datatypes are "str", "number", "bool", and "date".
col_width (Union[int, List[int]]): Width of columns in pixels. Can be provided as single value or list of values per column.
default (List[List[Any]]): Default value
type (str): Type of value to be returned by component. "pandas" for pandas dataframe, "numpy" for numpy array, or "array" for a Python array.
label (str): component name in interface.
@ -1101,6 +1102,7 @@ class Dataframe(InputComponent):
self.datatype = datatype
self.row_count = row_count
self.col_count = len(headers) if headers else col_count
self.col_width = col_width
self.type = type
self.default = default if default is not None else [[None for _ in range(self.col_count)] for _ in range(self.row_count)]
sample_values = {"str": "abc", "number": 786, "bool": True, "date": "02/08/1993"}
@ -1115,6 +1117,7 @@ class Dataframe(InputComponent):
"datatype": self.datatype,
"row_count": self.row_count,
"col_count": self.col_count,
"col_width": self.col_width,
"default": self.default,
**super().get_template_context()
}

View File

@ -1 +1 @@
2.2.7
2.2.8

View File

@ -5,7 +5,7 @@ except ImportError:
setup(
name='gradio',
version='2.2.7',
version='2.2.8',
include_package_data=True,
description='Python library for easily interacting with trained machine learning models',
author='Abubakar Abid',