v.0.9
On 2022.08.17
Last updated
Was this helpful?
Was this helpful?
# https://echarts.apache.org/examples/en/editor.html?c=line-style
raw_options: str = """
{
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'tpyth
},
series: [
{
data: [120, 200, 150, 80, 70, 110, 130],
type: 'line',
symbol: 'triangle',
symbolSize: 20,
lineStyle: {
color: '#5470C6',
width: 4,
type: 'dashed'
},
itemStyle: {
borderWidth: 3,
borderColor: '#EE6666',
color: 'yellow'
}
}
]
};
"""
s.plt.free_echarts(
raw_options=raw_options,
menu_path='test/raw-free-echarts',
order=2, rows_size=2, cols_size=12,
)xAxis: {
data: data.map(function (item) {
return item[0];
})
},data = [
{'product': 'Matcha Latte', '2015': 43.3, '2016': 85.8, '2017': 93.7},
{'product': 'Milk Tea', '2015': 83.1, '2016': 73.4, '2017': 55.1},
{'product': 'Cheese Cocoa', '2015': 86.4, '2016': 65.2, '2017': 82.5},
{'product': 'Walnut Brownie', '2015': 72.4, '2016': 53.9, '2017': 39.1}
]
options = {
'legend': {},
'tooltip': {},
'xAxis': {'type': 'category'},
'yAxis': {},
'series': [{'type': 'bar'}, {'type': 'bar'}, {'type': 'bar'}]
}
s.plt.free_echarts(
data=data,
options=options,
menu_path='test/free-echarts',
order=0, rows_size=2, cols_size=12,
)report_dataset_properties: Dict = {
'fields': [
{
'title': 'Personal information',
'fields': [
{
'mapping': 'name',
'fieldName': 'name',
'inputType': 'text',
},
{
'mapping': 'surname',
'fieldName': 'surname',
'inputType': 'text',
},
{
'mapping': 'age',
'fieldName': 'apythge',
'inputType': 'number',
},
{
'mapping': 'tel',
'fieldName': 'phone',
'inputType': 'tel',
},
{
'mapping': 'gender',
'fieldName': 'Gender',
'inputType': 'radio',
'options': ['Male', 'Female', 'No-binary', 'Undefined'],
},
{
'mapping': 'email',
'fieldName': 'email',
'inputType': 'email',
},
],
},
{
'title': 'Other data',
'fields': [
{
'mapping': 'skills',
'fieldName': 'Skills',
'options': ['Backend', 'Frontend', 'UX/UI', 'Api Builder', 'DevOps'],
'inputType': 'checkbox',
},
{
'mapping': 'birthDay',
'fieldName': 'Birthday',
'inputType': 'date',
},
{
'mapping': 'onCompany',
'fieldName': 'Time on Shimoku',
'inputType': 'dateRange',
},
{
'mapping': 'hobbies',
'fieldName': 'Hobbies',
'inputType': 'select',
'options': ['Make Strong Api', 'Sailing to Canarias', 'Send Abracitos'],
},
{
'mapping': 'textField2',
'fieldName': 'Test Text',
'inputType': 'text',
},
],
},
],
}
s.plt.input_form(
menu_path='test/input-form', order=0,
report_dataset_properties=report_dataset_properties
)
file_name = 'helloworld'
app_name = 'test'
object_data = b''
file_metadata: Dict = s.file.post_object(
business_id=business_id,
app_name=app_name,
file_name=file_name,
object_data=object_data
)
object: binary = s.file.get_object(
business_id=business_id,
app_name=app_name,
file_name=file_name,
)
file_name: str = 'df-test'
d = {'a': [1, 2, 3], 'b': [1, 4, 9]}
df_ = pd.DataFrame(d)
# Post dataframe to Shimoku
file: Dict = s.file.post_dataframe(
business_id=business_id,
app_name='test',
file_name=file_name,
df=df_,
)
# Retrieve it from Shimoku
df: pd.DataFrame = s.file.get_dataframe(
business_id=business_id,
app_name='test',
file_name=file_name,
)pytyesterday: dt.date = dt.date.today() - dt.timedelta(1)
file: Dict = s.file.get_file_by_date(
business_id=business_id,
date=yesterday,
file_name='helloworld',
app_name='test',
)