Commit e8ba34c8 authored by Boxiang Sun's avatar Boxiang Sun

erp5_officejs: A draft of interface definition for chart event and introspection in HTML5 format.

Draft version, this commit will amend later.

It contains the definition of some chart event interfaces which a gadget want to response a certain event occurred in a chart. Chart gadget will call this interfaces to pass parameters. Then gadget do some custom processing inside this function.

For chart introspection, chart gadget should provide the introspection interfaces. Then other gadgets can acquire this function to get internal value for a certain chart item by specify the chart id and item name.
parent efb59a4f
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Field parameters for response an event",
"properties": {
"value": {
"description": "Parameters which a event should contiains",
"properties": {
"chartType": {
"description": "Chart type, e.g 'line', 'bar', 'pie' , etc...",
"type": "string"
},
"itemType": {
"description": "Item type name, e.g 'series', 'markLine', 'markPoint', 'timeLine' ",
"type": "string"
},
"itemCategory": {
"description": "The category which this item belong. e.g. The item state marked as \"Opened\".",
"type": "string"
},
"itemGroup": {
"description": "The group which this item belong. e.g. The item grouped as \"Less than 2 days\".",
"type": "string"
},
"chartItemValue": {
"description": "The value of a certain chart item. Which may not a number, maybe a date, or what ever. So use string to represent.",
"type": "string"
},
"chartItemColor": {
"description": "The color of a certain chart item",
"type": "string"
}
},
"additionalProperties": false
}
},
"type": "object"
}
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>630d4ea27f4ecdef1f399f791eddc182</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_chart_event_interface_html_schema_json</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>File</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>gadget_chart_event_interface_html_schema.json</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Field parameters to specify an item in a certain chart gadget.",
"properties": {
"value": {
"description": "Parameters which a used to identify an item.",
"properties": {
"chartId": {
"description": "The id of a chart gadget.",
"type": "string"
},
"itemName": {
"description": "The chart item name.",
"type": "string"
}
},
"additionalProperties": false
}
},
"type": "object"
}
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>14078a530b5b9d2824ff5c3502b98d06</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_chart_instropection_interface_html_schema_json</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>File</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>gadget_chart_instropection_interface_html_schema.json</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<!DOCTYPE html>
<html>
<head>
<title>Graph Event Interface</title>
</head>
<body>
<h1>chart_event_interface(Draft)</h1>
<h3>List of chart events interface which can reponse the correspond events in a chart.</h3>
<p>
The purpose of this interface definition is to provide an unique API for various charting
libraries event processing. Then other gadget can provide these function to reponse chart's events.
</p>
<p>
Suppose a user use mouse to click one item in a chart. If another gadget want to reponse that event.
It need to provide the correspond function by <code>allowPublicAcquisition</code>. In this case,
the function is <code>chartItemClicked</code>. Chart gadget will pass parameters to this function.
Then the gadget can do some custom processing with the parameters in this function.
</p>
<dl>
<dt>chartItemClicked</dt>
<dd>Cilck an item in a chart.</dd>
<dl>
<dt data-parameter-required="required" data-parameter-type="object">event_params</dt>
<dd>
Schema available here : <a href="gadget_chart_event_interface_html_schema.json">gadget_chart_event_interface_html_schema.json</a><br>
<code style="display:block;white-space:pre-wrap">
One item in a chart was clicked. Any gadget which defined this function
can do some custom processing to response that event.
Please see json schema for supported parameters.
</code></dd>
</dl>
</dl>
<dl>
<dt>chartItemDblClick</dt>
<dd>Double cilck an item in a chart.</dd>
<dl>
<dt data-parameter-required="required" data-parameter-type="object">event_params</dt>
<dd>
Schema available here : <a href="gadget_chart_event_interface_html_schema.json">gadget_chart_event_interface_html_schema.json</a><br>
<code style="display:block;white-space:pre-wrap">
One item in a chart was double clicked. Any gadget which defined this
function can do some custom processing to response that event.
Please see json schema for supported parameters.
</code></dd>
</dl>
</dl>
<dl>
<dt>chartItemHover</dt>
<dd>Mouse pointer hovers on an item in a chart.</dd>
<dl>
<dt data-parameter-required="required" data-parameter-type="object">event_params</dt>
<dd>
Schema available here : <a href="gadget_chart_event_interface_html_schema.json">gadget_chart_event_interface_html_schema.json</a><br>
<code style="display:block;white-space:pre-wrap">
Mouse pointer hovers on one item in a chart. Any gadget which defined
this function can do some custom processing to response that event.
Please see json schema for supported parameters.
</code></dd>
</dl>
</dl>
<dl>
<dt>chartItemOut</dt>
<dd>Mouse pointer move out an item in a chart.</dd>
<dl>
<dt data-parameter-required="required" data-parameter-type="object">event_params</dt>
<dd>
Schema available here : <a href="gadget_chart_event_interface_html_schema.json">gadget_chart_event_interface_html_schema.json</a><br>
<code style="display:block;white-space:pre-wrap">
Mouse pointer move out an item in a chart. This is the counter part of
<code>chartItemHover</code>. Any gadget which defined this function
can do some custom processing to response that event.
Please see json schema for supported parameters.
</code></dd>
</dl>
</dl>
<dl>
<dt>chartItemSelected</dt>
<dd><strong>(Draft)</strong> One or more items were get selected in a chart.</dd>
<dl>
<dt data-parameter-required="required" data-parameter-type="object">event_params</dt>
<dd>
There must have a mechanism to save the items which current get selected.
I need to find out how does this get implemented in different chart libaries.
</dd>
</dl>
</dl>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Graph Introspection Interface(Draft)</title>
</head>
<body>
<h1>chart_introspection_interface</h1>
<h3>List of chart introspection interfaces which can let gadget to introspect the inside of a chart.</h3>
<p>
The purpose of this interface definition is to provide an unique
API for various charting libraries to introspect the chart itself. Then other gadget can provide these functions to introspect the chart.
</p>
<p>
Suppose a gadget want to a value of a specific item in a chart. It can aquire the correspond function by <code>declareAcquiredMethod</code>.
In this case, it is <code>getChartItemValue</code>. Chart wrapper gadget need to provide this function by using <code>allowPublicAcquisition</code>.
</p>
<p>
For now, the chart item was identified by <code>name</code> field. This need to do more investivation, For example, I'm not sure that if all chart
libraries support to assign different names for all items in the combined-bar chart.
</p>
<dl>
<dt>getChartItemValue</dt>
<dd>Get the value of an item in a chart.</dd>
<dl>
<dt data-parameter-required="required" data-parameter-type="object">item_name</dt>
<dd>
Schema available here : <a href="gadget_chart_introspection_interface_html_schema.json">gadget_chart_introspection_interface_html_schema.json</a><br>
<code style="display:block;white-space:pre-wrap">
Get the value of one item in a chart which specified by item name.
For now, the chart was idendifed by gadget id.
The chart item was identified by <code>name</code> field. This need to do more investivation,
For example, I'm not sure that if all chart libraries support to assign different names for all items in the combined-bar chart.
</code></dd>
</dl>
</dl>
<dl>
<dt>getChartItemColor</dt>
<dd>Get the color of an item in a chart.</dd>
<dl>
<dt data-parameter-required="required" data-parameter-type="object">item_name</dt>
<dd>
Schema available here : <a href="gadget_chart_introspection_interface_html_schema.json">gadget_chart_introspection_interface_html_schema.json</a><br>
<code style="display:block;white-space:pre-wrap">
Get the color of one item in a chart which specified by item name.
Parameter: Same as above.
</code>
</dd>
</dl>
</dl>
<dl>
<dt>getChartItemCategory</dt>
<dd>Get the category of an item which belonged to in a chart.</dd>
<dl>
<dt data-parameter-required="required" data-parameter-type="object">item_name</dt>
<dd>
Schema available here : <a href="gadget_chart_introspection_interface_html_schema.json">gadget_chart_introspection_interface_html_schema.json</a><br>
<code style="display:block;white-space:pre-wrap">
Get the category of an item which belonged to in a chart which specified by item name.
Parameter: Same as above.
</code></dd>
</dl>
</dl>
</body>
</html>
......@@ -8,6 +8,7 @@ web_site_module/officejs_audioplayer
web_site_module/officejs_audioplayer/**
web_page_module/ckeditor_*
image_module/ckeditor_*
web_page_module/gadget_chart_*
web_page_module/gadget_ckeditor_*
web_page_module/gadget_officejs_*
image_module/gadget_officejs_*
......
......@@ -3,6 +3,7 @@ image_module/officejs_todomvc_*
web_site_module/officejs_todomvc
web_page_module/ckeditor_*
image_module/ckeditor_*
web_page_module/gadget_chart_*
web_page_module/gadget_ckeditor_*
web_page_module/gadget_officejs_*
image_module/gadget_officejs_*
......
document_module/gadget_chart_*
document_module/gadget_field_*
document_module/gadget_officejs_*
image_module/ckeditor_*
......@@ -5,6 +6,7 @@ image_module/gadget_officejs_*
image_module/officejs_audioplayer_*
image_module/officejs_todomvc_*
web_page_module/ckeditor_*
web_page_module/gadget_chart_*
web_page_module/gadget_ckeditor_*
web_page_module/gadget_field_*
web_page_module/gadget_officejs_*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment