Title: [FR] Refactor Keyframe Data Structure for Simplified Parsing and Consistency · Issue #242 · Animated-Java/animated-java · GitHub
Open Graph Title: [FR] Refactor Keyframe Data Structure for Simplified Parsing and Consistency · Issue #242 · Animated-Java/animated-java
X Title: [FR] Refactor Keyframe Data Structure for Simplified Parsing and Consistency · Issue #242 · Animated-Java/animated-java
Description: Current Format: [ { "channel": "rotation", "data_points": [ { "x": "0", "y": "0", "z": "0" }, { "x": "0", "y": "2", "z": "0" } ] }, { "channel": "position", "data_points": [ { "x": "0", "y": "12", "z": "3" } ] }, { "channel": "command", ...
Open Graph Description: Current Format: [ { "channel": "rotation", "data_points": [ { "x": "0", "y": "0", "z": "0" }, { "x": "0", "y": "2", "z": "0" } ] }, { "channel": "position", "data_points": [ { "x": "0", "y": "12", ...
X Description: Current Format: [ { "channel": "rotation", "data_points": [ { "x": "0", "y": "0", "z": "0" }, { "x&quo...
Opengraph URL: https://github.com/Animated-Java/animated-java/issues/242
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[FR] Refactor Keyframe Data Structure for Simplified Parsing and Consistency","articleBody":"### Current Format:\r\n```json\r\n[\r\n {\r\n \"channel\": \"rotation\",\r\n \"data_points\": [\r\n {\r\n \"x\": \"0\",\r\n \"y\": \"0\",\r\n \"z\": \"0\"\r\n },\r\n {\r\n \"x\": \"0\",\r\n \"y\": \"2\",\r\n \"z\": \"0\"\r\n }\r\n ]\r\n },\r\n {\r\n \"channel\": \"position\",\r\n \"data_points\": [\r\n {\r\n \"x\": \"0\",\r\n \"y\": \"12\",\r\n \"z\": \"3\"\r\n }\r\n ]\r\n },\r\n {\r\n \"channel\": \"command\",\r\n \"data_points\": [\r\n {\r\n \"commands\": \"/say hi\",\r\n \"execute_condition\": \"\",\r\n \"repeat\": false,\r\n \"repeat_frequency\": 1\r\n }\r\n ]\r\n },\r\n {\r\n \"channel\": \"variant\",\r\n \"data_points\": [\r\n {\r\n \"variant\": \"e9fff953-e4bc-3879-4376-cf29c402492d\",\r\n \"execute_condition\": \"\"\r\n }\r\n ]\r\n }\r\n]\r\n```\r\n\r\n### Proposed Format:\r\n```json\r\n[\r\n {\r\n \"channel\": \"rotation\",\r\n \"data_point\": {\r\n \"x\": [\"0\", \"0\"],\r\n \"y\": [\"0\", \"2\"],\r\n \"z\": [\"0\", \"0\"]\r\n }\r\n },\r\n {\r\n \"channel\": \"position\",\r\n \"data_point\": {\r\n \"x\": [\"0\", \"0\"],\r\n \"y\": [\"12\", \"12\"],\r\n \"z\": [\"3\", \"3\"]\r\n }\r\n },\r\n {\r\n \"channel\": \"command\",\r\n \"data_point\": {\r\n \"commands\": \"/say hi\",\r\n \"execute_condition\": \"\",\r\n \"repeat\": false,\r\n \"repeat_frequency\": 1\r\n }\r\n },\r\n {\r\n \"channel\": \"variant\",\r\n \"data_point\": {\r\n \"variant\": \"e9fff953-e4bc-3879-4376-cf29c402492d\",\r\n \"execute_condition\": \"\"\r\n }\r\n }\r\n]\r\n```\r\n- Simplifies the format by using a unified `data_point` object, making it clear and predictable across all keyframes\r\n- Using pairs for transform keyframes (pre and post values) avoids complexity in handling different numbers of data points, streamlining data processing\r\n\r\n### Further Simplified Alternative:\r\n```json\r\n[\r\n {\r\n \"channel\": \"rotation\",\r\n \"x\": [\"0\", \"0\"],\r\n \"y\": [\"0\", \"2\"],\r\n \"z\": [\"0\", \"0\"]\r\n },\r\n {\r\n \"channel\": \"position\",\r\n \"x\": [\"0\", \"0\"],\r\n \"y\": [\"12\", \"12\"],\r\n \"z\": [\"3\", \"3\"]\r\n },\r\n {\r\n \"channel\": \"command\",\r\n \"commands\": \"/say hi\",\r\n \"execute_condition\": \"\",\r\n \"repeat\": false,\r\n \"repeat_frequency\": 1\r\n },\r\n {\r\n \"channel\": \"variant\",\r\n \"variant\": \"e9fff953-e4bc-3879-4376-cf29c402492d\",\r\n \"execute_condition\": \"\"\r\n }\r\n]\r\n```\r\n- By removing the `data_point` field and placing keyframe attributes directly under channel, the structure avoids redundant nesting, making it easier for developers to read and process\r\n\r\nI personally recommend adopting the further simplified format. It is the easiest to parse and offers the clearest and most straightforward approach.","author":{"url":"https://github.com/Dearliet","@type":"Person","name":"Dearliet"},"datePublished":"2024-07-26T12:17:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/242/animated-java/issues/242"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:20ae7cd0-2d5a-1d87-d866-c96f57e1b5ac |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8516:139E28:FF6C52:148AC84:699099F7 |
| html-safe-nonce | 0999daaa2d2cfd3a6e1dd7a7a311cd3afcd5a8edabaa413b73002796d1301043 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTE2OjEzOUUyODpGRjZDNTI6MTQ4QUM4NDo2OTkwOTlGNyIsInZpc2l0b3JfaWQiOiI1NTM2MDk1MDk0MjUxNTg2NDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 173ec02c76e398a221e1028ec9004bb98ee8630412ec96235ece64c537b09747 |
| hovercard-subject-tag | issue:2432116578 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/Animated-Java/animated-java/242/issue_layout |
| twitter:image | https://opengraph.githubassets.com/92af12062a31ff652c2a7b21b1ddcadfef8d9b02ef9aea37cfd4245ed93d965d/Animated-Java/animated-java/issues/242 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/92af12062a31ff652c2a7b21b1ddcadfef8d9b02ef9aea37cfd4245ed93d965d/Animated-Java/animated-java/issues/242 |
| og:image:alt | Current Format: [ { "channel": "rotation", "data_points": [ { "x": "0", "y": "0", "z": "0" }, { "x": "0", "y": "2", "z": "0" } ] }, { "channel": "position", "data_points": [ { "x": "0", "y": "12", ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Dearliet |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/Animated-Java/animated-java git https://github.com/Animated-Java/animated-java.git |
| octolytics-dimension-user_id | 83631375 |
| octolytics-dimension-user_login | Animated-Java |
| octolytics-dimension-repository_id | 364156984 |
| octolytics-dimension-repository_nwo | Animated-Java/animated-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 364156984 |
| octolytics-dimension-repository_network_root_nwo | Animated-Java/animated-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width