328 lines
11 KiB
JSON
328 lines
11 KiB
JSON
{
|
|
"capability": "origin.plot@v2",
|
|
"display_name": "Origin 科研绘图",
|
|
"default_enrollment": true,
|
|
"output_namespace": "origin",
|
|
"input_policy": {
|
|
"suffixes": [".csv", ".xlsx", ".json"],
|
|
"max_count": 16,
|
|
"max_bytes": 104857600,
|
|
"max_total_bytes": 536870912
|
|
},
|
|
"outputs": {
|
|
"project": {
|
|
"filename": "project.opju",
|
|
"media_type": "application/x-origin-project",
|
|
"relative_path": "project.opju",
|
|
"publish": true,
|
|
"required": false
|
|
},
|
|
"figure_png": {
|
|
"filename": "figure.png",
|
|
"media_type": "image/png",
|
|
"relative_path": "figure.png",
|
|
"publish": true,
|
|
"required": false
|
|
},
|
|
"figure_svg": {
|
|
"filename": "figure.svg",
|
|
"media_type": "image/svg+xml",
|
|
"relative_path": "figure.svg",
|
|
"publish": true,
|
|
"required": false
|
|
},
|
|
"figure_pdf": {
|
|
"filename": "figure.pdf",
|
|
"media_type": "application/pdf",
|
|
"relative_path": "figure.pdf",
|
|
"publish": true,
|
|
"required": false
|
|
},
|
|
"plot_spec": {
|
|
"filename": "plot-spec.json",
|
|
"media_type": "application/json",
|
|
"relative_path": ".meta/plot-spec.json",
|
|
"publish": false,
|
|
"required": true
|
|
},
|
|
"provenance": {
|
|
"filename": "provenance.json",
|
|
"media_type": "application/json",
|
|
"relative_path": ".meta/provenance.json",
|
|
"publish": false,
|
|
"required": true
|
|
}
|
|
},
|
|
"feature_path": ["operation", "plot", "type"],
|
|
"features": {
|
|
"line": "0.5.0",
|
|
"scatter": "0.5.0",
|
|
"line_scatter": "0.5.0",
|
|
"column": "0.5.0",
|
|
"bar": "0.5.0",
|
|
"grouped_column": "0.5.0",
|
|
"y_error": "0.5.0",
|
|
"contour": "0.5.0",
|
|
"surface_3d": "0.5.0",
|
|
"ternary": "0.5.0",
|
|
"heatmap": "0.5.0"
|
|
},
|
|
"summary": {
|
|
"title_path": ["operation", "plot", "title"]
|
|
},
|
|
"legacy_runtime": {
|
|
"detail_path": ["origin"],
|
|
"slots_path": ["available_slots"],
|
|
"assumed_adapter_version": "0.3.0"
|
|
},
|
|
"request_schema": {
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"type": "object",
|
|
"x-maxBytes": 262144,
|
|
"required": ["schema_version", "inputs", "operation", "outputs"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"schema_version": {"const": 2},
|
|
"inputs": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"maxItems": 16,
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["key", "artifact_id"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"key": {"type": "string", "pattern": "^[a-z][a-z0-9_]{0,31}$"},
|
|
"artifact_id": {"type": "string", "format": "uuid"},
|
|
"selector": {
|
|
"type": "object",
|
|
"required": ["sheet"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"sheet": {"type": "string", "minLength": 1, "maxLength": 128}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"operation": {
|
|
"type": "object",
|
|
"required": ["plot"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"plot": {
|
|
"type": "object",
|
|
"required": ["type", "series"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"type": {
|
|
"enum": [
|
|
"line", "scatter", "line_scatter", "column", "bar",
|
|
"grouped_column", "y_error", "contour", "surface_3d",
|
|
"ternary", "heatmap"
|
|
]
|
|
},
|
|
"series": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"maxItems": 16,
|
|
"uniqueItems": true,
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["input"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"input": {"type": "string", "pattern": "^[a-z][a-z0-9_]{0,31}$"},
|
|
"x": {"type": "string", "minLength": 1, "maxLength": 128},
|
|
"y": {"type": "string", "minLength": 1, "maxLength": 128},
|
|
"z": {"type": "string", "minLength": 1, "maxLength": 128},
|
|
"y_error": {"type": "string", "minLength": 1, "maxLength": 128},
|
|
"label": {"type": "string", "minLength": 1, "maxLength": 200},
|
|
"style": {"$ref": "#/$defs/series_style"}
|
|
}
|
|
}
|
|
},
|
|
"template": {"const": "publication_double_column"},
|
|
"title": {"type": "string", "maxLength": 500},
|
|
"title_style": {"$ref": "#/$defs/text_style"},
|
|
"canvas": {
|
|
"type": "object",
|
|
"required": ["width_mm", "height_mm"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"width_mm": {"type": "number", "minimum": 40, "maximum": 1000},
|
|
"height_mm": {"type": "number", "minimum": 40, "maximum": 1000}
|
|
}
|
|
},
|
|
"x_axis": {"$ref": "#/$defs/axis"},
|
|
"y_axis": {"$ref": "#/$defs/axis"},
|
|
"z_axis": {"$ref": "#/$defs/axis"},
|
|
"legend": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"enabled": {"type": "boolean"},
|
|
"position": {
|
|
"enum": ["top_left", "top_right", "bottom_left", "bottom_right"]
|
|
},
|
|
"font_size": {"type": "number", "minimum": 6, "maximum": 72}
|
|
}
|
|
},
|
|
"error_bars": {"type": "null"}
|
|
},
|
|
"allOf": [
|
|
{
|
|
"if": {"properties": {"type": {"enum": ["contour", "surface_3d", "ternary", "heatmap"]}}},
|
|
"then": {
|
|
"properties": {
|
|
"series": {
|
|
"maxItems": 1,
|
|
"items": {
|
|
"required": ["input", "x", "y", "z"],
|
|
"not": {"required": ["y_error"]}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"if": {"properties": {"type": {"const": "y_error"}}},
|
|
"then": {
|
|
"properties": {
|
|
"series": {
|
|
"items": {
|
|
"required": ["input", "x", "y", "y_error"],
|
|
"not": {"required": ["z"]}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"if": {"properties": {"type": {"const": "grouped_column"}}},
|
|
"then": {
|
|
"properties": {
|
|
"series": {
|
|
"minItems": 2,
|
|
"items": {
|
|
"required": ["input", "x", "y"],
|
|
"not": {"anyOf": [{"required": ["z"]}, {"required": ["y_error"]}]}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"if": {"properties": {"type": {"enum": ["line", "scatter", "line_scatter", "column", "bar"]}}},
|
|
"then": {
|
|
"properties": {
|
|
"series": {
|
|
"items": {
|
|
"required": ["input", "x", "y"],
|
|
"not": {"anyOf": [{"required": ["z"]}, {"required": ["y_error"]}]}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"outputs": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"maxItems": 4,
|
|
"uniqueItems": true,
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"type": "object",
|
|
"required": ["key", "type", "format"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"key": {"const": "project"},
|
|
"type": {"const": "project"},
|
|
"format": {"const": "opju"}
|
|
}
|
|
},
|
|
{
|
|
"type": "object",
|
|
"required": ["key", "type", "format"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"key": {"const": "figure_png"},
|
|
"type": {"const": "figure"},
|
|
"format": {"const": "png"},
|
|
"options": {
|
|
"type": "object",
|
|
"required": ["dpi"],
|
|
"additionalProperties": false,
|
|
"properties": {"dpi": {"type": "integer", "minimum": 72, "maximum": 1200}}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "object",
|
|
"required": ["key", "type", "format"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"key": {"const": "figure_svg"},
|
|
"type": {"const": "figure"},
|
|
"format": {"const": "svg"}
|
|
}
|
|
},
|
|
{
|
|
"type": "object",
|
|
"required": ["key", "type", "format"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"key": {"const": "figure_pdf"},
|
|
"type": {"const": "figure"},
|
|
"format": {"const": "pdf"}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"$defs": {
|
|
"axis": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"title": {"type": "string"},
|
|
"unit": {"type": "string"},
|
|
"scale": {"enum": ["linear", "log10", "ln", "log2"]},
|
|
"minimum": {"type": "number"},
|
|
"maximum": {"type": "number"},
|
|
"major_step": {"type": "number", "exclusiveMinimum": 0},
|
|
"tick_label_angle": {"type": "number", "minimum": -180, "maximum": 180},
|
|
"tick_label_font_size": {"type": "number", "minimum": 6, "maximum": 72},
|
|
"title_font_size": {"type": "number", "minimum": 6, "maximum": 72},
|
|
"grid": {"enum": ["none", "major", "major_minor"]}
|
|
}
|
|
},
|
|
"text_style": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"font_size": {"type": "number", "minimum": 6, "maximum": 72}
|
|
}
|
|
},
|
|
"series_style": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"color": {"type": "string", "pattern": "^#[0-9A-Fa-f]{6}$"},
|
|
"line_width": {"type": "number", "minimum": 0.1, "maximum": 20},
|
|
"line_style": {"enum": ["solid", "dash", "dot", "dash_dot", "dash_dot_dot"]},
|
|
"symbol": {"enum": ["circle", "square", "triangle_up", "diamond", "cross", "plus"]},
|
|
"symbol_size": {"type": "number", "minimum": 1, "maximum": 100},
|
|
"transparency": {"type": "integer", "minimum": 0, "maximum": 100}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|