|
16 | 16 | "from IPython.display import Image\n", |
17 | 17 | "import numpy as np\n", |
18 | 18 | "from simulariumio.medyan import MedyanConverter, MedyanData\n", |
19 | | - "from simulariumio import MetaData, DisplayData, ModelMetaData, BinaryWriter, InputFileData\n", |
| 19 | + "from simulariumio import MetaData, DisplayData, ModelMetaData, BinaryWriter, InputFileData, DISPLAY_TYPE\n", |
20 | 20 | "from simulariumio.filters import TranslateFilter" |
21 | 21 | ] |
22 | 22 | }, |
|
87 | 87 | " filament_display_data={\n", |
88 | 88 | " 0: DisplayData(\n", |
89 | 89 | " name=\"Filament\",\n", |
| 90 | + " display_type=DISPLAY_TYPE.SPHERE,\n", |
90 | 91 | " radius=5.0,\n", |
91 | 92 | " color=\"#ff1493\",\n", |
92 | 93 | " ),\n", |
93 | 94 | " },\n", |
94 | 95 | " linker_display_data={\n", |
95 | 96 | " 0: DisplayData(\n", |
96 | 97 | " name=\"LinkerA\",\n", |
| 98 | + " display_type=DISPLAY_TYPE.SPHERE,\n", |
97 | 99 | " radius=8.0,\n", |
98 | 100 | " color=\"#ffffff\",\n", |
99 | 101 | " ),\n", |
100 | 102 | " 1: DisplayData(\n", |
101 | 103 | " name=\"LinkerB\",\n", |
| 104 | + " display_type=DISPLAY_TYPE.SPHERE,\n", |
102 | 105 | " radius=8.0,\n", |
103 | 106 | " ),\n", |
104 | 107 | " 2: DisplayData(\n", |
105 | 108 | " name=\"LinkerC\",\n", |
| 109 | + " display_type=DISPLAY_TYPE.SPHERE,\n", |
106 | 110 | " radius=8.0,\n", |
107 | 111 | " ),\n", |
108 | 112 | " },\n", |
109 | 113 | " motor_display_data={\n", |
110 | 114 | " 1: DisplayData(\n", |
111 | 115 | " name=\"Motor\",\n", |
| 116 | + " display_type=DISPLAY_TYPE.SPHERE,\n", |
112 | 117 | " radius=2.0,\n", |
113 | 118 | " color=\"#0080ff\",\n", |
114 | 119 | " ),\n", |
115 | 120 | " },\n", |
116 | | - " agents_with_endpoints=[\"Motor\"]\n", |
| 121 | + " agents_with_endpoints=[\"Motor\"],\n", |
| 122 | + " center=True,\n", |
117 | 123 | ")" |
118 | 124 | ] |
119 | 125 | }, |
|
128 | 134 | "cell_type": "markdown", |
129 | 135 | "metadata": {}, |
130 | 136 | "source": [ |
131 | | - "Once your data is shaped like in the `example_data` object, you can use the converter to generate the file at the given path:\n", |
132 | | - "\n", |
133 | | - "(since MEDYAN coordinates are all positive, use a `TranslateFilter` to center the data in the viewer.)" |
| 137 | + "Once your data is shaped like in the `example_data` object, you can use the converter to generate the file at the given path:" |
134 | 138 | ] |
135 | 139 | }, |
136 | 140 | { |
|
151 | 155 | } |
152 | 156 | ], |
153 | 157 | "source": [ |
154 | | - "c = MedyanConverter(example_data)\n", |
155 | | - "translation_magnitude = -(box_size * scale) / 2\n", |
156 | | - "filtered_data = c.filter_data([\n", |
157 | | - " TranslateFilter(\n", |
158 | | - " translation_per_type={},\n", |
159 | | - " default_translation=translation_magnitude * np.ones(3)\n", |
160 | | - " ),\n", |
161 | | - "])\n", |
162 | | - "BinaryWriter.save(filtered_data, \"example_medyan\")" |
| 158 | + "MedyanConverter(example_data).save(\"example_medyan\")" |
163 | 159 | ] |
164 | 160 | }, |
165 | 161 | { |
|
0 commit comments