Skip to content

bug with subscripts and superscripts in 3D #1165

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

Closed
alexcjohnson opened this issue Nov 18, 2016 · 6 comments
Closed

bug with subscripts and superscripts in 3D #1165

alexcjohnson opened this issue Nov 18, 2016 · 6 comments
Assignees
Labels
bug something broken

Comments

@alexcjohnson
Copy link
Collaborator

As reported by @ellecj - the problem has a couple of layers...

If I try to make this plot:

Plotly.newPlot(gd, [
    {
      "type": "mesh3d",
      "y": [0, 1, 2],
      "x": [1, 2, 0],
      "z": [2, 0, 1],
      "i": [0],
      "j": [1],
      "k": [2]
    }
  ],
  {
    "title": "Triangle mesh",
    "scene": {
      "zaxis": {
        "title": "Z<sup>SUPER</sup><sub>SUB</sub>"
      }
    }
  })

I don't see any super or subscripts:
screen shot 2016-11-18 at 11 37 17 am

And then if I do a relayout:

Plotly.relayout(gd, {'scene.zaxis.title':'ZZZ<sup>2</sup><sub>a</sub>'})

I see a superscript but not a subscript:
screen shot 2016-11-18 at 11 38 47 am

@alexcjohnson alexcjohnson added the bug something broken label Nov 18, 2016
@etpinard
Copy link
Contributor

Some info on the topic:

HTML entities are converted to unicode in src/lib/html2unicode.js. In particular <sup></sup> are converted using superscript-text which appears to work only for lower case strings inside the <sup></sup> tags. Indeed, lower case strings are working fine. This is tested in the gl3d_log-axis-big mock.

Note that html2unicode makes no attempt at converting <sub></sub>.

@etpinard
Copy link
Contributor

@etpinard
Copy link
Contributor

cc @dfcreative

@archmoj
Copy link
Contributor

archmoj commented Nov 2, 2018

The example below is related to using lower case letters and <sup> which works with the PR #3207
Please note that here plus signs are used to avoid displaying the elements within <sup> tags to be parsed by GitHub viewer. Obviously one could omit them in the call.

Plotly.newPlot(gd, [
    {
      "type": "mesh3d",
      "y": [0, 1, 2],
      "x": [1, 2, 0],
      "z": [2, 0, 1],
      "i": [0],
      "j": [1],
      "k": [2]
    }
  ],
  {
    "title": "Triangle mesh",
    "scene": {
      "zaxis": {
        "title": "Z" + "" + "super script using numbers and only lower cases without" + "" + "'q'!"
      }
    }
  });

@archmoj
Copy link
Contributor

archmoj commented Nov 4, 2018

Now in the PR #3207 the superscripts and subscripts could be used in webgl; and they are not limited to lower cases.

@vvch
Copy link

vvch commented Nov 4, 2018

Now in the PR #3207 the superscripts and subscripts could be used in webgl

Thank you very much, it was very annoying bug. Maybe, it is also possible to use similar approach to fix related #608 bug?

@archmoj archmoj closed this as completed Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

4 participants