• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Can't get transform rotate() to work

    Mango Automation general Discussion
    3
    5
    1.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      v8dave
      last edited by Jared Wiltshire

      I found some code that Jared had posted previously for a 360 deg component and I am trying to get it to work but the value is not being shown.

      I am using the following to get the wind direction from the watch list.

      <ma-calc input="designer.points | filter:{name:'Wind Direction'}:true | maFirst" output="myDirection"></ma-calc>
      

      And then using this in the code for the display but the heading remains at 0.

          <g class="direction-cones" transform="rotate(-90)">
              <g id="north" transform="rotate({{myDirection.value}})">
                  <circle class="scale-1" r="100"></circle>
                  <circle class="scale-2" r="100"></circle>
              </g>
          </g>
      

      What am I doing wrong here?

      1 Reply Last reply Reply Quote 0
      • phildunlapP
        phildunlap
        last edited by

        Hi v8dave,

        I found some code that Jared had posted previously for a 360 deg component and I am trying to get it to work but the value is not being shown.

        Always good to link to the source material; is it this https://forum.infiniteautomation.com/topic/3915/very-basic-dashboard-designer-help ?

        1 Reply Last reply Reply Quote 0
        • Jared WiltshireJ
          Jared Wiltshire
          last edited by

          @v8dave Have you checked the value of the point is coming through by putting something like this on your page-

          <pre ng-bind="myDirection.value | json"></pre>
          

          Use the Chrome debugger to ensure that the transform attribute is being set correctly on your element. I suspect it may be a scope issue. i.e. your ma-calc element is defining the myDirection variable in a nested scope and it is inaccessible where you are trying to use it.

          Try this - change myDirection to designer.myDirection wherever you use it.

          I would also suggest using the ng-attr- prefix to prevent errors in your console.

          ng-attr-transform="rotate({{myDirection.value}})"
          

          Developer at Radix IoT

          1 Reply Last reply Reply Quote 0
          • V
            v8dave
            last edited by

            This is the error from the console.

            mangoUi~ngMango~ngMangoServices.js?v=f41ab677f738e8ffe5b8:39 Error: <g> attribute transform: Expected number, "rotate()".

            Jared WiltshireJ 1 Reply Last reply Reply Quote 0
            • Jared WiltshireJ
              Jared Wiltshire @v8dave
              last edited by Jared Wiltshire

              @v8dave said in Can't get heading to change:

              This is the error from the console.

              mangoUi~ngMango~ngMangoServices.js?v=f41ab677f738e8ffe5b8:39 Error: <g> attribute transform: Expected number, "rotate()".

              You have not addressed any of the other comments I have made. You can see from that error that myDirection.value is undefined. See above for how to solve and for how to stop the error in the console.

              Developer at Radix IoT

              1 Reply Last reply Reply Quote 0
              • First post
                Last post