Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by iwato

  1. Dsonesuk. It makes no difference how the viewbox width and height values are set; the result is both similar and different. Important is that the map image does not properly fill its container until the visitor as scrolled. I had tried fixing the value as you suggested earlier, but did not tell. My apologies. By the way, I have now tested it on another, non-Apple iPhone. The problem is the same. I conclude therefore that the issues lies with the Javascript. If I have understood the problem correctly. the onResize callback function of the object created by the JQVMaps vecto
  2. Oops! Thank you for the correction. I have been away from jQuery for several months ... Ha! Ha! Ha! In any case it makes no difference. Proper alignment only takes place with an iPhone scroll. I have not tested it on Android. onResize: function() { var containerWidth = $(this).parent().width(), containerHeight = (containerWidth * (2/3)); console.log('Parent: ' + $(this).parent().attr('id')); $(this).css({ 'width': containerWidth, 'height': containerHeight }).find('svg').attr('viewbox', "0 0 " + containerWidth + " " + containerHeight);
  3. So, I tried this the following. onResize: function() { var containerWidth = $(this).parent().width(), containerHeight = (containerWidth * (2/3)); console.log('Parent: ' + $(this).parent().attr('id')); $(this).css({ 'width': containerWidth, 'height': containerHeight }).find('svg').css('viewbox', "0 0 " + containerWidth + " " + containerHeight); console.log('Map Size: ' + containerWidth + 'x' + containerHeight); } RESULT: It had no effect on my browser responsiveness (a good thing), but it worsened the iPhone experience (bad thing).
  4. Hi, Dsonesuk! Truly I do not understand how I could incorporate what you are suggesting in the context of the problem. Surely you understand that the HTML that hosts the SVG object is pulled into an already formatted HTML page with AJAX in the form of a set of nested div tags that have their own style sheet and no document heading. Roddy
  5. The problem appears to be that the a change in the size of the viewport is not automatically registered as a change in the size of container. Once the page is scrolled the map fills the viewport and container as it should. Roddy
  6. I have never used console.log on an iPhone before and have no idea where to look for such information. Else, I would have looked long ago. Roddy
  7. Hi Dsonesuk! It appears not to make a difference. The width(), innerWidth(), and outerWidth() functions all yield the same result on the iPhone. What is unusual is both the placement and size of the map when the iPhone is placed on its side. For, rather than filling the center of the viewport, as it does when the iPhone is vertically positioned, it appears in the upper left-hand corner and retains the size that it had when the iPhone was horizontal. Roddy
  8. Thank you, Ingolme! Almost there. $('#vmap').vectorMap({ map: 'world_en', enableZoom: true, showTooltip: true, onResize: function() { var containerWidth = $(this).parent().width(), containerHeight = (containerWidth * (2/3)); $(this).css({ 'width': containerWidth, 'height': containerHeight }).find('svg').css({ 'width': containerWidth, 'height': containerHeight }); console.log('Map Size: ' + containerWidth + 'x' + containerHeight); } }); The above works well in a
  9. SoOK. So, I added the following onResize() function, but the error message remains the same and there is no change in the imagery. $('#vmap').vectorMap({ map: 'world_en', enableZoom: true, showTooltip: true, onResize: function() { var containerWidth = $('#wm_container').width, containerHeight = (containerWidth / 1.4); $(this).find('svg').css({ 'width': containerWidth, 'height': containerHeight }); console.log('Map Size: ' + containerWidth + 'x' + containerHeight); } }); Roddy
  10. Hello, JSG. Please read my note to Dsonesuk. In regard to the console.log() statement (see below) you would agree then, that the onResize() function provided as an option to the vectorMap() function is unnecessary to the resizing of the document. For, all it appears to do is tell the user what the result of the resize is, when, and if, it actually worked. onResize: function (element, width, height) { console.log('Map Size: ' + width + 'x' + height); } Roddy
  11. Hi, Dsonesuk. When I enter values other than 100% and auto for the height and width into the <div> tag that identifies the location of the map on the webpage, the map appears, but it is no longer responsive. It seems that I can have the map without responsive design, or responsive design without the map. This is the problem. Roddy
  12. BACKGROUND: I am introducing a new jQuery plug-in into my website, but it enters without any height -- this despite the fact that the width of the SVG object is fully responsive. You can see the problem on the Grammar Captive mainpage by clicking in the navigation bar under Visitor Profile / World Map. WEB INSPECTOR RESULTS: <div style="position: relative; overflow: hidden; background-color: rgb(165, 191, 221);" id="vmap"> <svg height="0" width="513"><g transform="scale(0) translate(Infinity, 0)"> <path class="jqvmap-region" id="jqvmap1_id" original="#f4f3f0"
  13. So, why is it that the dateCounter() function only returns one name-value pair in a single object, if the initial empty object is left out? The empty object appears to induce recursion, but I do not understand why. Roddy
  14. OK. you have adequately explained the following line of code. countDates[date] = ++countDates[date] || 1; Can you now explain this line of code. (countDates, date) => {...; return countDates;},{}) The result set, by the way, appears to be an object of name-value pairs which is exactly what I was hoping for when I introduced the function into my code. Object { 2019/01/01: 2, 2019/01/03: 4, 2019/01/04: 2, 2019/01/05: 2, 2019/01/06: 1, 2019/01/07: 2, 2019/01/09: 6, 2019/01/11: 1, 2019/01/18: 3, 2019/01/20: 2, 60 moreā€¦ } Roddy
  15. BACKGROUND: Recently I discovered a nifty Javascript function that counts the like values of an index array and returns as its value an object whose property-value pairs consist of a single repeated value and its corresponding frequency. Unfortunately, I am having trouble understanding how the function works. As I have adapted it to fit my own needs I have changed the variable names. Indeed, this change may be the source of my own confusion. The FUNCTION: function dateCounter(dates) { return dates.reduce( (countDates, date) => { countDates[da
  16. If you like my suggestion, pass your cursor over the heart and select the trophy. Roddy
  17. I suppose that the conclusion to this discussion is that anything sent via an HTTP request is vulnerable and that one should protect one's MySQL database from potential threats with the use of prepared statements. This said, I am confused about their use. Is it sufficient to prepare and bind a statement only once, and then execute the prepared and bound statement with fresh data as many times as one wants? Roddy
  18. Have you tried tipue? Roddy
  19. Hi, JSG! Understood. Thank you. Access to neither the local Matomo server, nor the local Grammar Captive database is direct. The Matomo server is located in one domain and the PHP class documents and PHP data fetch, translation, and storage code document are located in another domain on the same server. The Matomo server is accessed using a cURL routine and Matomo authentication key. The translated data is stored in data tables that are accessed with two MySQLi objects constructed with two separate SQL queries using password authentication. In brief, both the Matomo API an
  20. BACKGROUND: As always I am concerned about security on the one hand, but do not wish to over-code on the other. In the following outlined procedure the data is fetched from the super secure, vast thicket of layered PHP and sent after translation THE PROCEDURE: Create two MySQL tables linked with a foreign key. Make a method call to the Matomo API and retrieve a four tiered nested array containing two tiers of visitor data. The first tier consists of an indexed array whose 100 elements each corresponds to a single visit to the Grammar Captive website. The second tier
  21. Hi, Funce! Thank you for your quick response. It was you who gave me the idea of creating a data table. And, now I have two: one for each visit and one for all of the actions and events associated with each visit. Hooray! Hooray! In regard to the TranslateMatomoAction class I understand now clearly about the __contructor() function. I was trying to make it do something that it was not intended to do. This said, I was unable to get the __invoke() function to work as you suggested. So, I moved the contents of the __constructor() function outside of the class and changed the variab
  22. BACKGROUND: Many moons ago it was suggested that I create a CRON job that would read into a MySQL table the results of a method call to a Matomo API call and thereby speed up the rendering of data for visitors to the Grammar Captive website. I have since come to learn that this technique is called data translation. The following code creates a class object that when inserted into a foreach loop is suppose to fill the properties of the object for further manipulation. Unfortunately it does perform the intended task. THE CLASS class TranslateMatomoAction { public $mysqli_obj; p
  23. So, in the end, the table was corrupted, and I had no back up. Alas, I reconstructed the entire table with UTF-8 encoding. The result was nothing but spectacular. I now have an in-tact Mecab parser that parses Japanese. Not only this, but the Mecab parser does not interfere with the parsing of French, English, and German., or likely any other language that using blank spaces to separate words. Arabic will be my next challenge, but I am fairly confident that it will work just like English with no additional encoding required. Roccy
  24. Thank you, JSG. I do not know a thing about C, let alone the argv and argc parameter. This said, I can well imagine. No, no, no. I am not eager to learn still another computing language! I am having enough trouble with the ones, that I have already attempted. It has never been my goal to become an online developer. It just sort of happened out of curiosity and in self-defense. Roddy p.s. Great Link!
  25. Yes, your link is the same that caused me to ask the question. I will explore a little further with the idea of looking for a command. Thank you for responding. Roddy
  • Create New...