New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pretty print figure json #212

Merged
merged 1 commit into from May 5, 2017

Conversation

Projects
None yet
3 participants
@will-moore
Member

will-moore commented Apr 29, 2017

This PR pretty-prints the json when saving a figure file, so that the
json in the file is human readable and more amenable to version control (since it's not all on one line).

See https://trello.com/c/sQw7eU4K/15-pretty-print-json-when-saving-to-file

To test:
- Save a figure file and note the file-annotation ID (in figure URL)
- Get the original file ID: select file from annotation where id=32052
- Check that the file is nicely formatted - Can download the file after manually attaching the figure file to an Image in the clients OR find the original file ID and go to /webclient/get_original_file/{id}/
- Refresh the figure page to check that the file still loads correctly.

@waxenegger

This comment has been minimized.

Show comment
Hide comment
@waxenegger

waxenegger May 1, 2017

Member

Attached manually and downloaded thereafter. Json looks nicely formatted:

{
  "figureName": "Figure_2017-5-1_20:25:41",
  "height_mm": 297,
  "legend": "",
  "legend_collapsed": true,
  "orientation": "vertical",
  "page_col_count": 1,
  "page_count": 1,
  "page_size": "A4",
  "panels": [
    {
      "channels": [
        {
          "active": true,
          "color": "0000FF",
          "emissionWave": 470,
          "label": "CFP-JP4",
          "reverseIntensity": true,
          "window": {
            "end": 197,
            "max": 197,
            "min": 103,
            "start": 103
          }
        },
        {
          "active": true,
          "color": "FF0000",
          "emissionWave": 617,
          "label": "RD-TR-PE",
          "reverseIntensity": false,
          "window": {
            "end": 124,
            "max": 124,
            "min": 96,
            "start": 96
          }
        }
      ],
      "datasetId": 1457,
      "datasetName": "archivedv",
      "deltaT": [],
      "dx": 0,
      "dy": 0,
      "height": 512,
      "imageId": 9443,
      "labels": [
        {
          "color": "000000",
          "position": "top",
          "size": 12,
          "text": "[google](http://google.com)"
        }
      ],
      "name": "/home/hudson/for_import_to_howe/archived-imoprt-case/user-1/private-1/no_projects/archivedv/CFPNEAT01_R3D.dv.log",
      "orig_height": 512,
      "orig_width": 512,
      "pixel_size_x": 0.12698,
      "pixel_size_x_symbol": "\u00b5m",
      "pixel_size_x_unit": "MICROMETER",
      "pixel_size_y": 0.12698,
      "rotation": 0,
      "selected": true,
      "shapes": [
        {
          "id": 308801,
          "radiusX": 82.7961657297979,
          "radiusY": 37.95723529794617,
          "rotation": 0,
          "strokeColor": "#0032e5",
          "strokeWidth": 6,
          "type": "Ellipse",
          "x": 202.90019790656572,
          "y": 73.80268984340069
        },
        {
          "id": -6036535494419957,
          "strokeColor": "#0032e5",
          "strokeWidth": 6,
          "type": "Arrow",
          "x1": 111.24363636363637,
          "x2": 248.08727272727273,
          "y1": 173.14909090909092,
          "y2": 40.02909090909091
        }
      ],
      "sizeT": 1,
      "sizeZ": 29,
      "theT": 0,
      "theZ": 14,
      "width": 512,
      "x": 41.5,
      "y": 165,
      "zoom": 100
    }
  ],
  "paper_height": 842,
  "paper_spacing": 50,
  "paper_width": 595,
  "version": 2,
  "width_mm": 210
}

Refresh of figure page showed no errors either.

Member

waxenegger commented May 1, 2017

Attached manually and downloaded thereafter. Json looks nicely formatted:

{
  "figureName": "Figure_2017-5-1_20:25:41",
  "height_mm": 297,
  "legend": "",
  "legend_collapsed": true,
  "orientation": "vertical",
  "page_col_count": 1,
  "page_count": 1,
  "page_size": "A4",
  "panels": [
    {
      "channels": [
        {
          "active": true,
          "color": "0000FF",
          "emissionWave": 470,
          "label": "CFP-JP4",
          "reverseIntensity": true,
          "window": {
            "end": 197,
            "max": 197,
            "min": 103,
            "start": 103
          }
        },
        {
          "active": true,
          "color": "FF0000",
          "emissionWave": 617,
          "label": "RD-TR-PE",
          "reverseIntensity": false,
          "window": {
            "end": 124,
            "max": 124,
            "min": 96,
            "start": 96
          }
        }
      ],
      "datasetId": 1457,
      "datasetName": "archivedv",
      "deltaT": [],
      "dx": 0,
      "dy": 0,
      "height": 512,
      "imageId": 9443,
      "labels": [
        {
          "color": "000000",
          "position": "top",
          "size": 12,
          "text": "[google](http://google.com)"
        }
      ],
      "name": "/home/hudson/for_import_to_howe/archived-imoprt-case/user-1/private-1/no_projects/archivedv/CFPNEAT01_R3D.dv.log",
      "orig_height": 512,
      "orig_width": 512,
      "pixel_size_x": 0.12698,
      "pixel_size_x_symbol": "\u00b5m",
      "pixel_size_x_unit": "MICROMETER",
      "pixel_size_y": 0.12698,
      "rotation": 0,
      "selected": true,
      "shapes": [
        {
          "id": 308801,
          "radiusX": 82.7961657297979,
          "radiusY": 37.95723529794617,
          "rotation": 0,
          "strokeColor": "#0032e5",
          "strokeWidth": 6,
          "type": "Ellipse",
          "x": 202.90019790656572,
          "y": 73.80268984340069
        },
        {
          "id": -6036535494419957,
          "strokeColor": "#0032e5",
          "strokeWidth": 6,
          "type": "Arrow",
          "x1": 111.24363636363637,
          "x2": 248.08727272727273,
          "y1": 173.14909090909092,
          "y2": 40.02909090909091
        }
      ],
      "sizeT": 1,
      "sizeZ": 29,
      "theT": 0,
      "theZ": 14,
      "width": 512,
      "x": 41.5,
      "y": 165,
      "zoom": 100
    }
  ],
  "paper_height": 842,
  "paper_spacing": 50,
  "paper_width": 595,
  "version": 2,
  "width_mm": 210
}

Refresh of figure page showed no errors either.

@jburel jburel merged commit d3f2816 into ome:master May 5, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jburel jburel added this to the 3.1.0 milestone Jun 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment